Skip to content

Commit

Permalink
📝 docs: Batch 서버 HealthCheck 방식 변경 #121
Browse files Browse the repository at this point in the history
  • Loading branch information
jun02160 committed Mar 2, 2024
1 parent 9a0b2fb commit cb6cd59
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/batch/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUNNING_CONTAINER_NAME=$(echo "$DOCKER_PS_OUTPUT" | awk '{print $NF}')
IS_REDIS_ACTIVATE=$(docker ps | grep redis)
IS_GREEN_ACTIVATE=$(docker ps | grep green-batch)

WEB_HEALTH_CHECK_URL=/actuator/health
WEB_HEALTH_CHECK_URL=/api/health

# Redis Docker Image Pull
if [ -z "$IS_REDIS_ACTIVATE" ];then
Expand Down Expand Up @@ -65,10 +65,10 @@ if [ -z $IS_GREEN_ACTIVATE ]; then
sleep 3

RESPONSE=$(curl -s http://localhost:${CURRENT_SERVER_PORT}${WEB_HEALTH_CHECK_URL})
UP_COUNT=$(echo $RESPONSE | grep 'UP' | wc -l)
UP_COUNT=$(echo $RESPONSE | grep 'success' | wc -l)
echo "[$NOW_TIME] Health check 응답: ${RESPONSE}"

if [ $UP_COUNT -ge 1 ]; then # "UP" 문자열이 1개 이상 존재한다면 헬스체크 통과
if [ $UP_COUNT -ge 1 ]; then # "success" 문자열이 1개 이상 존재한다면 헬스체크 통과
echo "[$NOW_TIME] Health check 성공!"
break;
else
Expand Down Expand Up @@ -112,10 +112,10 @@ else
sleep 3

RESPONSE=$(curl -s http://localhost:${CURRENT_SERVER_PORT}${WEB_HEALTH_CHECK_URL})
UP_COUNT=$(echo $RESPONSE | grep 'UP' | wc -l)
UP_COUNT=$(echo $RESPONSE | grep 'success' | wc -l)
echo "[$NOW_TIME] Health check 응답: ${RESPONSE}"

if [ $UP_COUNT -ge 1 ]; then # "UP" 문자열이 1개 이상 존재한다면 헬스체크 통과
if [ $UP_COUNT -ge 1 ]; then # "success" 문자열이 1개 이상 존재한다면 헬스체크 통과
echo "[$NOW_TIME] Health check 성공!"
break;
else
Expand Down Expand Up @@ -144,7 +144,7 @@ echo "----------------------------------------------------------------------"

# Nginx를 통해서 서버에 접근 가능한지 확인
RESPONSE=$(curl -s http://localhost:${CURRENT_SERVER_PORT}${WEB_HEALTH_CHECK_URL})
UP_COUNT=$(echo $RESPONSE | grep 'UP' | wc -l)
UP_COUNT=$(echo $RESPONSE | grep 'success' | wc -l)
echo "[$NOW_TIME] Health check 응답: ${RESPONSE}"

if [ $UP_COUNT -ge 1 ]
Expand Down

0 comments on commit cb6cd59

Please sign in to comment.