docker shell springboot

#!/bin/sh -l
#export BUILD_ID=dontKillMe这一句很重要,这样指定了,项目启动之后才不会被Jenkins杀掉。
export BUILD_ID=dontKillMe


#Jenkins中编译好的jar位置
jar_path=/root/.jenkins/workspace/autotest/target/

#Jenkins中编译好的jar名称
jar_name=demo-1.0.jar

fuser -k -n tcp 80

#进入指定的编译好的jar的位置
cd  ${jar_path}


#启动jar,指定SpringBoot的profiles为test,后台启动
nohup java -jar -Dspring.profiles.active=test ${jar_name} &

猜你喜欢

转载自blog.csdn.net/zhou8622/article/details/103600394