From 84effcba20017c5076a5d219d23872f845c4ae23 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Sun, 3 Mar 2024 01:27:07 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20deploy.sh=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/api/deploy.sh | 6 ++++-- scripts/batch/deploy.sh | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/api/deploy.sh b/scripts/api/deploy.sh index c8bfe66..9551776 100644 --- a/scripts/api/deploy.sh +++ b/scripts/api/deploy.sh @@ -75,9 +75,10 @@ if [ -z $IS_GREEN_ACTIVATE ]; then echo "[$NOW_TIME] Health check의 응답을 알 수 없거나 status가 UP이 아닙니다." fi - if [ $retry_count -eq 10 ]; then + if [ $retry_count -eq 15 ]; then echo "[$NOW_TIME] Health check 실패.." echo "[$NOW_TIME] Nginx에 연결하지 않고 배포를 종료합니다." + docker-compose stop green-api exit 1 fi done; @@ -122,9 +123,10 @@ else echo "[$NOW_TIME] Health check의 응답을 알 수 없거나 status가 UP이 아닙니다." fi - if [ $retry_count -eq 10 ]; then + if [ $retry_count -eq 15 ]; then echo "[$NOW_TIME] Health check 실패.." echo "[$NOW_TIME] Nginx에 연결하지 않고 배포를 종료합니다." + docker-compose stop blue-api exit 1 fi done; diff --git a/scripts/batch/deploy.sh b/scripts/batch/deploy.sh index 6d0bf9a..fad1cb8 100644 --- a/scripts/batch/deploy.sh +++ b/scripts/batch/deploy.sh @@ -134,8 +134,8 @@ fi echo "----------------------------------------------------------------------" # Nginx를 통해서 서버에 접근 가능한지 확인 -RESPONSE=$(curl -s http://localhost:${CURRENT_SERVER_PORT}${WEB_HEALTH_CHECK_URL}) -UP_COUNT=$(echo $RESPONSE | grep 'success' | wc -l) +RESPONSE=$(sudo lsof -i :${CURRENT_SERVER_PORT}) +UP_COUNT=$(echo $RESPONSE | grep 'docker' | wc -l) echo "[$NOW_TIME] Health check 응답: ${RESPONSE}" if [ $UP_COUNT -ge 1 ]