Jenkins bash执行错误

时间:2016-08-15 08:03:30

标签: bash shell jenkins amazon-ec2

https://github.com/oliverlloyd/jmeter-ec2

脚本:https://github.com/oliverlloyd/jmeter-ec2/blob/master/jmeter-ec2.sh

如果我使用Mac bash版本3.2执行它,我会尝试从Jenkins运行此脚本。它的运行完美,但在詹金斯,它告诉我脚本有错误。

Jenkins Bash版本:4.3-14 Ubuntu

完成Shell输出:

[Loadtest API - EC2] $ /bin/sh -xe /tmp/hudson8877679109648570428.sh
+ count=1 sudo ./jenkins-ec2.sh api/cam_api_test2.jmx api_host=api.dir.sf-test1.com,users=2000,steps=100,load=240,steps_rate=10,ramp=5
Cloning into 'jmeter-ec2'...
Writing jmeter-ec2 properties
Writing SSH Config
Adding Custom Properties
../jmeter-ec2/jmeter-ec2.sh: line 57: /var/lib/jenkins/workspace/Loadtest: No such file or directory
basename: extra operand ‘-’
Try 'basename --help' for more information.
../jmeter-ec2/jmeter-ec2.sh: line 87: [: too many arguments
WARN: Did not see a custom jmeter.properties file. Please ensure the remote hosts have the required settings 'jmeter.save.saveservice.output_format=csv' and 'jmeter.save.saveservice.thread_counts=true'
ERROR: Could not find test plan at the following location: /var/lib/jenkins/workspace/Loadtest API - EC2/test_project/jmx/.jmx
Finished: SUCCESS
  1. 错误

    ../ jmeter-ec2 / jmeter-ec2.sh:line 57:/ var / lib / jenkins / workspace / Loadtest:没有这样的文件或目录 basename:额外的操作数' - ' 试试' basename --help'了解更多信息。

  2. 脚本行

    LOCAL_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    #Output LOCAL_HOME "/var/lib/jenkins/workspace/Loadtest API - EC2"
    
    # Execute the jmeter-ec2.properties file, establishing these constants.
    . $LOCAL_HOME/jmeter-ec2.properties
    
    1. 错误

      ../ jmeter-ec2 / jmeter-ec2.sh:第87行:[:参数太多

    2. 脚本行

          if [ -r $LOCAL_HOME/jmeter.properties ] ; then
      

      请求帮助。

0 个答案:

没有答案