Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] deploy.sh 프로세스 종료, 환경변수 가져오기 안되는 에러 #147

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ DEPLOY_PATH=/home/ubuntu/app/nonstop/jar/
cp $BUILD_PATH $DEPLOY_PATH

echo "> 현재 구동중인 Set 확인"
if [ $DEPLOY_ENV == main ]
then
if [ $DEPLOY_ENV = "main" ]; then
echo $DEPLOY_ENV
CURRENT_PROFILE=$(curl -s https://api.tattour.shop/profile)
elif [ $DEPLOY_ENV == dev ]
then
CURRENT_PROFILE=$(curl -s https://api.tattour.shop/profile) || { echo "Curl 요청 실패";}
elif [ $DEPLOY_ENV = "dev" ]; then
echo $DEPLOY_ENV
CURRENT_PROFILE=$(curl -s https://dev.tattour.shop/profile)
CURRENT_PROFILE=$(curl -s https://dev.tattour.shop/profile) || { echo "Curl 요청 실패";}
else
echo "> DEPLOY_ENV가 설정되지 않았습니. DEPLOY_ENV: $DEPLOY_ENV"
echo "> DEPLOY_ENV가 설정되지 않았습니다. DEPLOY_ENV: $DEPLOY_ENV"
exit 1
fi
echo "> $CURRENT_PROFILE"

# 쉬고 있는 set 찾기: set1이 사용중이면 set2가 쉬고 있고, 반대면 set1이 쉬고 있음
# 쉬고 있는 set 찾기
if [ $CURRENT_PROFILE == set1 ]
then
IDLE_PROFILE=set2
Expand Down Expand Up @@ -58,7 +57,7 @@ else
fi

echo "> $IDLE_PROFILE 배포"
# echo "> nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=$IDLE_PROFILE $IDLE_APPLICATION_PATH >> /home/ubuntu/app/nohup.out 2>&1 & "
echo "> nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=$IDLE_PROFILE $IDLE_APPLICATION_PATH >> /home/ubuntu/app/nohup.out 2>&1 & "
nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=$IDLE_PROFILE $IDLE_APPLICATION_PATH >> /home/ubuntu/app/nohup.out 2>&1 &

echo "> $IDLE_PROFILE 10초 후 Health check 시작"
Expand Down