From ecc7bff47c371d6a9166613e3b9aa6ee9502a127 Mon Sep 17 00:00:00 2001 From: Junho Hwang <72647031+juno-junho@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:46:32 -0700 Subject: [PATCH] Update deploy-blue-green.sh --- scripts/deploy-blue-green.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/deploy-blue-green.sh b/scripts/deploy-blue-green.sh index 1e8ae6d6..2d8839fe 100644 --- a/scripts/deploy-blue-green.sh +++ b/scripts/deploy-blue-green.sh @@ -1,7 +1,6 @@ #!/bin/bash -# jasypt 암호키 설정 -source /home/ubuntu/action/scripts/properties.sh +source /home/ubuntu/action/scripts/properties.sh # jasypt 암호키 설정 PROJECT_NAME=space-club-backend REPOSITORY=/home/ubuntu @@ -10,6 +9,12 @@ JAR_NAME=$(ls -tr $PACKAGE | grep 'SNAPSHOT.jar' | tail -n 1) JAR_PATH=$PACKAGE$JAR_NAME echo "> build 파일명: $JAR_NAME" +# 금칙어 리스트 복사 (최신화) +PROFANITY_LIST_LOCATION_TO_STORE=$REPOSITORY/bad_word_list.txt +PROFANITY_LIST_LOCATION=$REPOSITORY/action/src/main/resources/secrets/bad_word_list.txt +echo "> 금칙어 list 복사" +cp $PROFANITY_LIST_LOCATION $PROFANITY_LIST_LOCATION_TO_STORE + echo "> build 파일 복사" DEPLOY_PATH=$REPOSITORY/jar/ cp $JAR_PATH $DEPLOY_PATH @@ -18,7 +23,7 @@ echo "> 현재 구동중인 SET 확인" CURRENT_PROFILE=$(curl -s http://localhost/api/profile) echo "> $CURRENT_PROFILE" -# 쉬고 있는 set 찾기: set1이 사용중이면 set2가 쉬고 있고, 반대면 set1이 쉬고 있음 +# 쉬고 있는 set 찾기: blue가 사용중이면 green이 쉬고 있고, 반대면 blue가 쉬고 있음 if [ $CURRENT_PROFILE == blue ] then IDLE_PROFILE=green @@ -53,7 +58,7 @@ else fi echo "> $IDLE_PROFILE 배포" -sudo nohup java -jar $IDLE_APPLICATION_PATH --spring.profiles.active=develop,$IDLE_PROFILE --jasypt.encryptor.password=${encrypt} > /home/ubuntu/log/nohup_log.out 2> /home/ubuntu/log/nohup_error.out & +sudo nohup java -jar $IDLE_APPLICATION_PATH --spring.profiles.active=develop,$IDLE_PROFILE --jasypt.encryptor.password=${encrypt} ----bad-word.path=$PROFANITY_LIST_LOCATION_TO_STORE > /home/ubuntu/log/nohup_log.out 2> /home/ubuntu/log/nohup_error.out & echo "> $IDLE_PROFILE 10초 후 Health check 시작" echo "> curl -s http://localhost:$IDLE_PORT/actuator/health "