0
点赞
收藏
分享

微信扫一扫

Spring Boot单个服务通过jenkins+popeline持续集成持续部署

闲云困兽 2022-07-12 阅读 62


pipeline{
agent any
stages {
stage('Build'){
steps{

sh 'export BUILD_ID=dontKillMe'
sh 'source /etc/profile'

sh '''
if [ `ps -ef | grep hcuufile-0.0.1-SNAPSHOT.jar | grep -v grep | awk '{print $2}'`{print $2}' | xargs kill -9 $2''

sh 'mvn clean package spring-boot:repackage'
withEnv(['JENKINS_NODE_COOKIE=dontkillme']) {
sh """

nohup java -Dhudson.util.ProcessTree.disable=true -jar /var/lib/jenkins/workspace/HCUUFILE_JENKINS_2/target/hcuufile-0.0.1-SNAPSHOT.jar > output 2>&1 &
"""
}
}
}
}
}


举报

相关推荐

0 条评论