Skip to content

Commit

Permalink
Merge pull request #86 from letmeknowmyfriend/Chore/Set_Up_For_Deploy
Browse files Browse the repository at this point in the history
[Chore] deploy.sh 수정 close #85
  • Loading branch information
ChaCha3088 authored Dec 28, 2023
2 parents 5d6972a + 8060ca9 commit a3af7ea
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a3af7ea

Please sign in to comment.