Skip to content

Commit

Permalink
πŸ‘· 살짝 μˆ˜μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
soyeon207 authored Nov 8, 2023
1 parent f9b9dd6 commit 749d2eb
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ APPLICATION_LOG_PATH="/home/ubuntu/$PROJECT_NAME/log/application.log"
BUILD_JAR=$(ls $JAR_PATH)
JAR_NAME=$(basename $BUILD_JAR)

echo "===== 배포 μ‹œμž‘ : $(date +%c) =====" >> $DEPLOY_LOG_PATH

echo "> build 파일λͺ…: $JAR_NAME" >> $DEPLOY_LOG_PATH
echo "> build 파일 볡사" >> $DEPLOY_LOG_PATH
cp $BUILD_JAR $DEPLOY_PATH
# echo "===== 배포 μ‹œμž‘ : $(date +%c) =====" >> $DEPLOY_LOG_PATH

echo "> ν˜„μž¬ λ™μž‘μ€‘μΈ μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜ pid 체크" >> $DEPLOY_LOG_PATH
CURRENT_PID=$(pgrep -f $JAR_NAME)
# echo "> build 파일λͺ…: $JAR_NAME" >> $DEPLOY_LOG_PATH
# echo "> build 파일 볡사" >> $DEPLOY_LOG_PATH
# cp $BUILD_JAR $DEPLOY_PATH

# echo "> ν˜„μž¬ λ™μž‘μ€‘μΈ μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜ pid 체크" >> $DEPLOY_LOG_PATH
# CURRENT_PID=$(pgrep -f $JAR_NAME)

if [ -z $CURRENT_PID ]
then
Expand All @@ -28,12 +29,17 @@ else
kill -9 $CURRENT_PID
fi

cd $DEPLOY_PATH

./gradlew build
./gradlew build

DEPLOY_JAR=$DEPLOY_PATH$JAR_NAME
echo "> DEPLOY_JAR 배포" >> $DEPLOY_JAR
# echo "> DEPLOY_JAR 배포" >> $DEPLOY_JAR
mkdir $DEPLOY_LOG_DIR_PATH

nohup java -jar -Dspring.profiles.active=local $DEPLOY_JAR --server.port=8080 >> $APPLICATION_LOG_PATH 2> $DEPLOY_ERR_LOG_PATH &
nohup java -jar -Dspring.profiles.active=local $JAR_PATH --server.port=8080 >> $APPLICATION_LOG_PATH 2> $DEPLOY_ERR_LOG_PATH &

sleep 3

echo "> 배포 μ’…λ£Œ : $(date +%c)" >> $DEPLOY_LOG_PATH
# echo "> 배포 μ’…λ£Œ : $(date +%c)" >> $DEPLOY_LOG_PATH

0 comments on commit 749d2eb

Please sign in to comment.