我的shell命令在终端中运行时有效,但在Jenkins管道中没有;当管道运行test.sh
时,shell运行,但bug服务不运行。为什么会这样,我该如何解决这个问题?
run.sh
:
nohup /usr/local/java/1.8/bin/java -Dspring.cloud.config.profile=test -Dspring.cloud.config.uri=http://localhost:8888/ -cp /data/jcpt/service/service-account/jar/.:/data/jcpt/service/service-account/jar/lib/* com.caifubao.jcpt.account.app.AccountApplication >./logs/service-account.log &
Jenkins管道:
stage('UPLOAD') {
agent{node { label "TEST" }}
steps {
sh "./test.sh"
}
}