Last active
July 6, 2018 07:41
-
-
Save jungbin-kim/f593998447560df8b1bbdb15309a44bf to your computer and use it in GitHub Desktop.
Spring boot excutable jar 파일을 Jenkins로 배포하기 위해서 `빌드 후 조치` > Send build artifacts over SSH > Exec command 내용
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 <target path> | |
# Stop 만들어진 PID로 서비스 종료 | |
pid=`cat ./RUNNING_PID 2> /dev/null` | |
if [ "$pid" == "" ] | |
then | |
printf "Is not running" | |
else | |
echo "Stopping..." | |
sudo kill $pid | |
fi | |
# Start 및 해당 PID 파일로 만들기 | |
sudo nohup java -jar ./testJenkins-0.0.1-SNAPSHOT.jar 2>> /dev/null >> /dev/null & | |
sudo echo $! > ./RUNNING_PID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CI - 젠킨스 빌드하기 에서 Add build step 참고
원래 돌고 있던 서비스 프로세스 종료 시킬때 사용하고 있던 port로 종료하는 방법도 존재