Jenkins 基本詹金斯管道故障
我有一个在Openshift上运行的Jenkins 1.6。我正在尝试构建一个简单的Jenkins管道,它从Git存储库构建:Jenkins 基本詹金斯管道故障,jenkins,openshift,jenkins-pipeline,Jenkins,Openshift,Jenkins Pipeline,我有一个在Openshift上运行的Jenkins 1.6。我正在尝试构建一个简单的Jenkins管道,它从Git存储库构建: node { git url: 'https://github.com/fmarchioni/kitchensink-example.git' def mvnHome = tool 'M3' sh "${mvnHome}/bin/mvn clean install" } 当我尝试构建管道时,它失败了,并显示一条不清楚的消息: [Pipeline] node
node {
git url: 'https://github.com/fmarchioni/kitchensink-example.git'
def mvnHome = tool 'M3'
sh "${mvnHome}/bin/mvn clean install"
}
当我尝试构建管道时,它失败了,并显示一条不清楚的消息:
[Pipeline] node
Running on master in /var/lib/jenkins/jobs/pipeline/workspace
[Pipeline] {
[Pipeline] git
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/fmarchioni/kitchensink-example.git # timeout=10
Fetching upstream changes from https://github.com/fmarchioni/kitchensink-example.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress https://github.com/fmarchioni/kitchensink-example.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 90df980f2c86f9a59d872bc8650ecfd0800c51bd (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 90df980f2c86f9a59d872bc8650ecfd0800c51bd # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git branch -D master # timeout=10
> git checkout -b master 90df980f2c86f9a59d872bc8650ecfd0800c51bd
First time build. Skipping changelog.
[Pipeline] tool
[Pipeline] sh
[workspace] Running shell script
+ /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/M3/bin/mvn clean install
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -1
Finished: FAILURE
你知道会出什么问题吗?
谢谢我怀疑特定的shell脚本,
mvn clean install
出错了。如果可以,请尝试将SSHing插入盒带,然后直接尝试Mavin命令。您将能够添加调试选项(从),并希望看到一些更有用的输出 尝试使用withMaven步骤将命令括起来。这将允许指定maven工具版本和JDK,以及其他配置选项
withMaven(jdk: '<JDK name>', maven: '<maven name>') {
sh 'mvn clean install'
}
withMaven(jdk:“”,maven:“”){
sh“mvn清洁安装”
}
它还将在build.log中记录配置:
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options:
[withMaven] use JDK installation <JDK name>
[withMaven] use Maven installation '<maven name>'
[Pipeline] sh
[workspace] Running shell script
[Pipeline]with maven
[withMaven]选项:[]
[withMaven]可用选项:
[withMaven]使用JDK安装
[withMaven]使用Maven安装“”
[管道]上海
[工作区]正在运行shell脚本
您可能希望了解如何使用管道语法链接。它可以生成可用于各个步骤的代码段。它将显示withMaven步骤可用的选项