Skip to content

Commit

Permalink
feat(workflow): container name 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
junhyeongkim2 committed Oct 14, 2024
1 parent b26690b commit 5d743c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/build_new_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ cp -R /home/ubuntu/develop/backend/build/libs/* build/libs_new/
CURRENT_CONTAINER=$(docker ps --filter "name=campride-api-server" --format "{{.Names}}")
echo "Current container: $CURRENT_CONTAINER"
if [ "$CURRENT_CONTAINER" == "campride-api-server-blue" ]; then
NEW_CONTAINER="campride-api-server-green"
NEW_CONTAINER="app-green"
else
NEW_CONTAINER="campride-api-server-blue"
NEW_CONTAINER="app-blue"
fi

# 새 버전의 이미지 빌드
Expand Down
4 changes: 3 additions & 1 deletion scripts/start_application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ cd /home/ubuntu/develop/backend
CURRENT_CONTAINER=$(docker ps --filter "name=campride-api-server" --format "{{.Names}}")
if [ "$CURRENT_CONTAINER" == "campride-api-server-blue" ]; then
NEW_CONTAINER="campride-api-server-green"
NEW_CONTAINER_NAME="app-green"
NEW_PORT=8081
CURRENT_PORT=8080
else
NEW_CONTAINER="campride-api-server-blue"
NEW_CONTAINER_NAME="app-blue"
NEW_PORT=8080
CURRENT_PORT=8081
fi

# 새 컨테이너 시작
docker-compose up -d $NEW_CONTAINER
docker-compose up -d $NEW_CONTAINER_NAME

# 새 컨테이너가 준비될 때까지 대기
echo "Waiting for the new container to be ready..."
Expand Down

0 comments on commit 5d743c1

Please sign in to comment.