【发布时间】:2018-07-06 02:51:53
【问题描述】:
我在 MacOS-HighSierra 上使用带有管道的 Jenkins 版本 2.121.1。 我的项目依赖于登录服务器,这是一个 Springboot 工件,在本地运行,我想在构建之前启动它。我有一个 shell 脚本来启动登录服务器。 shell 脚本在命令行中运行良好。当我在 Jenkins 的上下文中运行相同的内容时,它失败了。下面是 runloginserver shell 脚本中的代码:
nohup java -jar /absolute/path/login-module/login-api.jar >/dev/null 2>&1 &
在我的 Jenkinsfile 中,我将阶段定义如下:
stage('Launch-login') {
steps {
script{
withEnv(['JENKINS_NODE_COOKIE=dontkill']) {
sh '/absolute/path/runloginserver '
}
}
}
}
控制台输出没有错误。没有生成 nohup.out。并且服务器还没有启动
【问题讨论】:
标签: spring-boot jenkins jenkins-pipeline macos-high-sierra