1 Star 0 Fork 4

wangwsh / helloworld

forked from 梅孝亮 / helloworld 
Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

helloworld

jenkins 脚本

# 保留进程,这个配置参考:https://www.jianshu.com/p/f67d8e0f8092
BUILD_ID=dontKillMe

# 端口、项目构建后目录、项目构建后名称
PORT=10001
SERVICE_DIR=/var/jenkins_home/workspace/helloworld/target
SERVICE_NAME=helloworld-0.0.1-SNAPSHOT.jar

# 每次进程启动前,查询该进程是否已启动。若启动,则干掉
TEMP_PID=`ps -ef | grep -w "$SERVICE_NAME" | grep  "java" | awk '{print $2}'`
if [ "$TEMP_PID" != "" ]; then
   kill -9 $TEMP_PID
fi

# 跳转到构建后目录,指定端口启动 jar 包
cd $SERVICE_DIR
nohup java -jar $SERVICE_NAME --server.port=$PORT &

Comments ( 0 )

Sign in for post a comment

About

springboot helloworld spread retract
Java
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
Java
1
https://git.oschina.net/wangwsh/helloworld.git
git@git.oschina.net:wangwsh/helloworld.git
wangwsh
helloworld
helloworld
master

Search