我想在碼頭集裝箱中用Jenkins和管道插件建立我的項目。我Jenkinsfile
看起來是這樣的:jenkins 2.7管道建在碼頭集裝箱
node('docker') {
docker.image('build-node:1').inside {
stage 'scm checkout'
checkout scm
stage 'maven build'
sh "mvn -B clean > mvn.log"
}
}
在詹金斯日誌:
...
Entering stage maven build
Proceeding
[Pipeline] sh
[versioning] Running shell script
+ mvn -B clean
[Pipeline] }
$ docker stop ***
$ docker rm -f ***
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -1
Finished: FAILURE
在mvn.log我看到一切正常:
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: X.XXX s
[INFO] Finished at: 2016-XX-XXTXX:XX:XX+XX:XX
[INFO] Final Memory: XXM/XXXM
[INFO] ------------------------------------------------------------------------
哪裏是錯誤或如何確定呢?
我的Jenkins服務器是docker容器表單docker hub,它使用docker服務器作爲節點。
新的檢查:
try {
sh 'mvn clean | tee mvn.log'
} catch (e) {
println "Maven failed : ${e}"
}
輸出:
[versioning] Running shell script
+ mvn clean
+ tee mvn.log
[Pipeline] echo
Maven failed : hudson.AbortException: script returned exit code -1
mvn.log:
[INFO] BUILD SUCCESS
https://issues.jenkins-ci.org/browse/JENKINS-35430 – burtsevyg