Skip to content

Commit

Permalink
refactor: 배포 스크립트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
alstn113 committed Jan 8, 2025
1 parent 91cebc1 commit 2b37348
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions server/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ switch_container() {
echo "Starting $next_container..."
docker compose -f compose.yml up "$next_container" -d

# sleep 5
sleep 5

# if ! health_check "$health_check_url"; then
# echo "Health check failed, rolling back..."
# docker compose -f compose.yml down "$next_container"
# return
# fi
if ! health_check "$health_check_url"; then
echo "Health check failed, rolling back..."
docker compose -f compose.yml down "$next_container"
return
fi

sed -i "s/server $prev_container:8080;/server $next_container:8080;/" "$NGINX_CONFIG_PATH"

Expand All @@ -75,6 +75,8 @@ switch_container() {
fi

echo "$next_container is now live and accepting requests!"

docker compose -f compose.yml down "$prev_container"
}

IS_GREEN=$(docker container ps | grep app-green)
Expand Down

0 comments on commit 2b37348

Please sign in to comment.