1 Star 0 Fork 4

梅孝亮 / 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
README.md 647 Bytes
Copy Edit Web IDE Raw Blame History
梅孝亮 authored 2019-04-09 20:40 . 更新 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 &

Comment ( 0 )

Sign in for post a comment

Java
1
https://git.oschina.net/meixl/helloworld.git
git@git.oschina.net:meixl/helloworld.git
meixl
helloworld
helloworld
master

Search