From 1ea4f207b764f9cbb0e9241ee559382a367daca2 Mon Sep 17 00:00:00 2001 From: pushedrumex Date: Fri, 2 Feb 2024 01:28:14 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B0=B0=ED=8F=AC=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appspec.yml | 2 +- scripts/deploy.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/appspec.yml b/appspec.yml index d7eb8be..dc32a80 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: / - destination: /home/ubuntu/app + destination: /home/ubuntu/app/indp-server overwrite: true permissions: diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 3cecf72..175c907 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,27 +1,27 @@ -PROJECT_ROOT=/app +PROJECT_ROOT=/home/ubuntu/app PROJECT_NAME=indp-server APPLICATION_NAME=indp DEPLOY_PATH=$PROJECT_ROOT/deploy DEPLOY_LOG=$DEPLOY_PATH/deploy.log -echo "✅ Build 파일 복사" +echo "✅ Build 파일 복사" >> $DEPLOY_LOG cp $PROJECT_ROOT/$PROJECT_NAME/build/libs/*.jar $DEPLOY_PATH/ -echo "✅ 현재 구동 중인 애플리케이션 pid 확인" +echo "✅ 현재 구동 중인 애플리케이션 pid 확인" >> $DEPLOY_LOG CURRENT_PID=$(pgrep -f $APPLICATION_NAME.*.jar) -echo "✅ 현재 구동 중인 애플리케이션 pid: $CURRENT_PID" +echo "✅ 현재 구동 중인 애플리케이션 pid: $CURRENT_PID" >> $DEPLOY_LOG if [ -z "$CURRENT_PID" ]; then - echo "✅ 현재 구동 중인 애플리케이션이 없으므로 종료하지 않습니다." + echo "✅ 현재 구동 중인 애플리케이션이 없으므로 종료하지 않습니다." >> $DEPLOY_LOG else - echo "✅ kill -15 $CURRENT_PID" + echo "✅ kill -15 $CURRENT_PID" >> $DEPLOY_LOG kill -15 "$CURRENT_PID" sleep 5 fi -echo "✅ 새 어플리케이션 배포" +echo "✅ 새 어플리케이션 배포" >> $DEPLOY_LOG JAR_NAME=$(ls -tr "$DEPLOY_PATH" | grep jar | tail -n 1) -echo "✅ JAR Name: $JAR_NAME" +echo "✅ JAR Name: $JAR_NAME" >> $DEPLOY_LOG nohup java -jar $DEPLOY_PATH/$JAR_NAME --spring.profiles.active=dev > $DEPLOY_LOG 2>&1 &