在jenkins中构建失败为build.sh:未找到

时间:2016-01-21 07:52:16

标签: jenkins

我正在詹金斯建立一个自由风格的项目。将执行shell脚本的设置配置为

build.sh -label $JOB_NAME -$BUILD_NUMBER -java_home $JAVA_HOME

当我尝试构建项目时,我有一个控制台输出作为构建失败。

Building in workspace /var/lib/jenkins/workspace/jmxweb
[jmxweb] $ /bin/sh -xe /tmp/hudson4723307331600368596.sh
+ build.sh -label jmxweb -8 -java_home /usr/lib/jvm/java-7-oracle
/tmp/hudson4723307331600368596.sh: 2: /tmp/hudson4723307331600368596.sh: build.sh: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

2 个答案:

答案 0 :(得分:1)

根据documentation

构建非源控制项目

有时需要仅为演示目的构建项目,或者无法访问SVN / CVS存储库。通过选择在“源代码管理”下将项目配置为“无”,您将不得不:

1 Build the Project at least once, (it will fail), but Jenkins will create the structure jenkins/workspace/PROJECTNAME/
2 Copy the project files to jenkins/workspace/PROJECTNAME/
3 Build again and configure appropriately

答案 1 :(得分:0)

尝试运行:$ WORKSPACE / build.sh -label $ JOB_NAME - $ BUILD_NUMBER -java_home $ JAVA_HOME

错误肯定是因为它无法找到您正在寻找它的文件。明确指定路径应确保它在当前工作空间中查找它。 祝好运!