Skip to content

Commit

Permalink
Modify/#398 infra zero down time (#423)
Browse files Browse the repository at this point in the history
* chore: 서브모듈 커밋 시점 변경

* docs: 액츄에이터 의존성 추가

* infra: 무중단 배포를 위한 cd 스크립트 변경

* infra: 테스트와 빌드 하나로 통합

* infra: 스크립트 수정

* infra: 스크립트 수정

* infra: 스크립트 수정

* infra: 스크립트 수정

* infra: 스크립트 수정

* infra: 스크립트 수정

* infra: 스크립트 수정

* infra: 서비스 상태 체크 및 종료 로직 추가

* infra: 에러를 반환하는 코드 수정
  • Loading branch information
dwax1324 authored Oct 24, 2024
1 parent b84c61f commit e541551
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/Backend-CD-Prod-A.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ jobs:
SUCCESS=false
for i in {1..10}; do
HTTP_STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:80/actuator/health)
if [ "$HTTP_STATUS" -eq 200 ]; then
HTTP_STATUS=$(curl -o /dev/null -s -w -f "%{http_code}" http://localhost:80/actuator/health)
if [ $? -eq 0 ] && [ "$HTTP_STATUS" -eq 200 ]; then
echo "Service is up and running"
SUCCESS=true
break
else
echo "Attempt $i: Service is not responding. HTTP Status: $HTTP_STATUS"
sleep 3
fi
echo "Attempt $i: Service is not responding..."
sleep 3
done
- name: Port forwarding end
Expand All @@ -68,6 +69,6 @@ jobs:
- name: Exit if fails
run: |
if [ "$SUCCESS" = false ]; then
echo "Service did not respond successfully after $ATTEMPTS attempts"
echo "Service did not respond successfully after $ATTEMPTS attempts, stopping github actions.."
sudo exit 1
fi
13 changes: 7 additions & 6 deletions .github/workflows/Backend-CD-Prod-B.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ jobs:
SUCCESS=false
for i in {1..10}; do
HTTP_STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:80/actuator/health)
if [ "$HTTP_STATUS" -eq 200 ]; then
HTTP_STATUS=$(curl -o /dev/null -f -s -w "%{http_code}" http://localhost:80/actuator/health)
if [ $? -eq 0 ] && [ "$HTTP_STATUS" -eq 200 ]; then
echo "Service is up and running"
SUCCESS=true
break
else
echo "Attempt $i: Service is not responding. HTTP Status: $HTTP_STATUS"
sleep 3
fi
echo "Attempt $i: Service is not responding..."
sleep 3
done
- name: Port forwarding end
Expand All @@ -68,6 +69,6 @@ jobs:
- name: Exit if fails
run: |
if [ "$SUCCESS" = false ]; then
echo "Service did not respond successfully after $ATTEMPTS attempts"
echo "Service did not respond successfully after 10 attempts, stopping github actions.."
sudo exit 1
fi

0 comments on commit e541551

Please sign in to comment.