-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd4faca
commit 1ea4f20
Showing
2 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 & |