Skip to content

Commit

Permalink
Test: 블루-그린 무중단 배포 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
tioon committed Jun 30, 2024
1 parent 713b28d commit 9b39e5d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
script: |
# 현재 활성화된 Nginx 설정 파일 확인
CURRENT_CONF=$(sudo readlink /etc/nginx/active.conf)
echo "Current Nginx configuration: $CURRENT_CONF"
if [[ "$CURRENT_CONF" == *"nginx.blue.conf" ]]; then
NEW_CONF="/etc/nginx/nginx.green.conf"
OLD_CONTAINER="blue-container"
Expand All @@ -69,6 +70,11 @@ jobs:
NEW_PORT=8000
fi
echo "New Nginx configuration: $NEW_CONF"
echo "Old container: $OLD_CONTAINER"
echo "New container: $NEW_CONTAINER"
echo "New port: $NEW_PORT"
# 새 Docker 이미지 가져오기 및 새로운 컨테이너 실행
sudo docker pull ${{secrets.DOCKERHUB_USERNAME}}/qtudy-server
sudo docker run -d -p $NEW_PORT:8080 --name $NEW_CONTAINER ${{secrets.DOCKERHUB_USERNAME}}/qtudy-server
Expand All @@ -83,5 +89,8 @@ jobs:
sudo docker rm $OLD_CONTAINER
fi
# 실행 중인 Docker 컨테이너 확인
sudo docker ps
# 사용하지 않는 Docker 이미지 정리
sudo docker image prune -f

0 comments on commit 9b39e5d

Please sign in to comment.