Skip to content

Commit

Permalink
Update deploy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ReadMyMemory authored Apr 20, 2024
1 parent 8c16f1b commit 5980ea0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#!/bin/bash
BUILD_JAR=$(ls /home/ubuntu/app/kgu-0.0.1-SNAPSHOT.jar)
BUILD_JAR="/home/ubuntu/app/kgu-0.0.1-SNAPSHOT.jar"
JAR_NAME=$(basename $BUILD_JAR)

echo "> 현재 시간: $(date)" >> /home/ubuntu/app/log/deploy.log

echo "> build 파일명: $JAR_NAME" >> /home/ubuntu/app/log/deploy.log

echo "> build 파일 복사" >> /home/ubuntu/app/log/deploy.log
DEPLOY_PATH=/home/ubuntu/app/deploy/
cp $BUILD_JAR $DEPLOY_PATH

echo "> 현재 실행중인 애플리케이션 pid 확인" >> /home/ubuntu/app/log/deploy.log
CURRENT_PID=$(pgrep -f $JAR_NAME)

Expand All @@ -22,7 +18,5 @@ else
sleep 5
fi


DEPLOY_JAR=$DEPLOY_PATH$JAR_NAME
echo "> DEPLOY_JAR 배포" >> /home/ubuntu/app/log/deploy.log
sudo nohup java -jar $DEPLOY_JAR >> /home/ubuntu/app/log/deploy.log 2>/home/ubuntu/app/log/deploy_err.log &
sudo nohup java -jar $BUILD_JAR >> /home/ubuntu/app/log/deploy.log 2>/home/ubuntu/app/log/deploy_err.log &

0 comments on commit 5980ea0

Please sign in to comment.