From 8060ca923d2deef05b25612ae79546064c4d2a42 Mon Sep 17 00:00:00 2001 From: ChaCha3088 Date: Thu, 28 Dec 2023 22:46:04 +0900 Subject: [PATCH] =?UTF-8?q?[Chore]=20deploy.sh=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 859be42..283449d 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -6,16 +6,21 @@ cd $REPOSITORY JAR_NAME=$(ls $REPOSITORY/build/libs/ | grep 'SNAPSHOT.jar' | tail -n 1) JAR_PATH=$REPOSITORY/build/libs/$JAR_NAME +# 현재 시간 +echo "CURRENT_TIME: $(date '+%Y%m%d %H:%M:%S')" >> $REPOSITORY/deploy.log +echo "REPOSITORY: $REPOSITORY" >> $REPOSITORY/deploy.log + CURRENT_PID=$(pgrep -f $APP_NAME) +echo "CURRENT_PID: $CURRENT_PID" >> $REPOSITORY/deploy.log + if [ -z $CURRENT_PID ] then - echo "> 종료할 애플리케이션이 없습니다." + echo "> 종료할 애플리케이션이 없습니다." >> $REPOSITORY/deploy.log else - echo "> kill -15 $CURRENT_PID" + echo "> kill -15 $CURRENT_PID" >> $REPOSITORY/deploy.log kill -15 $CURRENT_PID - sleep 30 fi -echo "> Deploy - $JAR_PATH " nohup java -jar $JAR_PATH --spring.profiles.active=prod > $REPOSITORY/nohup.out 2>&1 & +echo "> Deploy - $JAR_PATH\n" >> $REPOSITORY/deploy.log