Skip to content

Commit

Permalink
Fix(#14): 컨테이너 못 찾는 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
dongkyun0713 authored Jul 18, 2024
1 parent 74615d5 commit 2b65c66
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
username: ${{ env.EC2_SSH_USER }}
key: ${{ env.PRIVATE_KEY }}
script: |
if [ -e sudo docker ps -a -f name=${{ env.CONTAINER_NAME_BLUE }} ]; then
if sudo docker ps -a -f name=${{ env.CONTAINER_NAME_BLUE }} | grep -q "${{ env.CONTAINER_NAME_BLUE }}"; then
sudo docker pull ${{ env.DOCKER_IMAGE_NAME }}
sudo docker run --name ${{ env.CONTAINER_NAME_GREEN }} -d -p ${{ env.GREEN_PORT }}:${{ env.GREEN_PORT }} -e SPRING_PROFILES_ACTIVE=green -e TZ=Asia/Seoul ${{ env.DOCKER_IMAGE_NAME }}:latest
sleep 30
Expand All @@ -69,5 +69,4 @@ jobs:
sudo docker stop ${{ env.CONTAINER_NAME_GREEN }}
sudo docker rm ${{ env.CONTAINER_NAME_GREEN }}
fi
sleep 20
sudo systemctl reload nginx

0 comments on commit 2b65c66

Please sign in to comment.