Last active
May 28, 2019 06:18
-
-
Save vector4wang/bfdee3f239f999586c9a4e5cc3637ce2 to your computer and use it in GitHub Desktop.
[jenkins打包java项目脚本] jenkins打包的配置脚本,通过端口号找到服务并停止 #Java #SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /app/resume-engine-rc/ | |
curServicePid=`netstat -anp|grep 8989|awk '{printf $7}'|cut -d/ -f1` | |
if [ -n "$curServicePid" ];then | |
kill -9 $curServicePid | |
fi | |
rm -rf * | |
cp /app/jenkins-temp/* /app/resume-engine-rc/ | |
unzip *.zip | |
cd resume-update-engine/ | |
pwd | |
source /etc/profile | |
java -version | |
nohup java -jar resume-update-engine.jar --rc >/dev/null 2>&1 & | |
rm -rf /app/jenkins-temp/* | |
echo ">>>>end<<<<" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment