Skip to content

Instantly share code, notes, and snippets.

@vector4wang
Last active May 28, 2019 06:18
Show Gist options
  • Save vector4wang/bfdee3f239f999586c9a4e5cc3637ce2 to your computer and use it in GitHub Desktop.
Save vector4wang/bfdee3f239f999586c9a4e5cc3637ce2 to your computer and use it in GitHub Desktop.
[jenkins打包java项目脚本] jenkins打包的配置脚本,通过端口号找到服务并停止 #Java #SSH
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