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 ]