【发布时间】:2018-07-09 16:03:39
【问题描述】:
我正在尝试构建一个管道来构建一个在 github 上提交的 java maven 项目管道。 我已经在我的 Windows 机器上安装了 jenkins。 我的管道在以下阶段受到打击
Started by user Akshay Katti
Obtained Jenkinsfile from git C:\Users\ak186148\git\Kylo-Accelerator
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in C:\Users\ak186148\.jenkins\workspace\Kylo-Promoter-CI-CD
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url C:\Users\ak186148\git\Kylo-Accelerator # timeout=10
Fetching upstream changes from C:\Users\ak186148\git\Kylo-Accelerator
> git.exe --version # timeout=10
> git.exe fetch --tags --progress C:\Users\ak186148\git\Kylo-Accelerator +refs/heads/*:refs/remotes/origin/*
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
> git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision e8ad0282a7fbd877461b3866a15f0116b2848065 (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f e8ad0282a7fbd877461b3866a15f0116b2848065
Commit message: "Add initial Jenkinsfile"
> git.exe rev-list --no-walk e8ad0282a7fbd877461b3866a15f0116b2848065 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
[C:\Users\ak186148\.jenkins\workspace\Kylo-Promoter-CI-CD] Running shell script
nohup: failed to run command 'sh': No such file or directory
process apparently never started in C:\Users\ak186148\.jenkins\workspace\Kylo-Promoter-CI-CD@tmp\durable-b24ab647
[Pipeline] sh
[C:\Users\ak186148\.jenkins\workspace\Kylo-Promoter-CI-CD] Running shell script
nohup: failed to run command 'sh': No such file or directory
process apparently never started in C:\Users\ak186148\.jenkins\workspace\Kylo-Promoter-CI-CD@tmp\durable-5e2947b3
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE
请在附件中找到我的 Jenkinsfile(我已从 sh 更改为 bat)
pipeline {
agent {
docker {
image 'maven:3-alpine'
args '-v /root/.m2:/root/.m2'
}
}
stages {
stage('Build')
{
steps {
bat 'mvn -B -DskipTests clean package'
}
}
}
}
另外请在蓝海页面的错误下方找到 blue_ocean_error
请帮忙。
【问题讨论】:
-
我得到了这个确切的错误,尽管我的管道声明有些不同。如果您弄明白了,如果您能在此处发布答案,将会大有帮助,因为即使我发布了一个新问题,它也会作为您的重复问题而被关闭。
-
你们有什么发现吗?由于 Jenkins->Docker 交互,这似乎是一个问题。我将 Docker 作为命令运行,但它似乎与使用非 root 用户有关。 medium.com/@garunski/…
标签: java maven jenkins jenkins-plugins jenkins-pipeline