Skip to content

Commit

Permalink
refactor: 문법 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kanguk01 committed Nov 1, 2024
1 parent ea1901a commit 16345a0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ jobs:
NEW_VERSION=${{ env.NEW_VERSION }}
NEW_PORT=${{ env.NEW_PORT }}
script: |
sudo docker pull kimsongmok/splanet:${IMAGE_TAG}
echo "Deploying with IMAGE_TAG=$IMAGE_TAG, NEW_VERSION=$NEW_VERSION, NEW_PORT=$NEW_PORT"
sudo docker pull kimsongmok/splanet:$IMAGE_TAG
sudo docker network inspect splanet >/dev/null 2>&1 || sudo docker network create splanet
sudo docker run -d --name splanet_${NEW_VERSION} \
sudo docker run -d --name splanet_$NEW_VERSION \
--network splanet \
--env-file /home/ubuntu/env.properties \
-p ${NEW_PORT}:8080 --restart unless-stopped kimsongmok/splanet:${IMAGE_TAG}
-p $NEW_PORT:8080 --restart unless-stopped kimsongmok/splanet:$IMAGE_TAG
- name: Wait for Spring Boot Application to Start
uses: appleboy/[email protected]
Expand All @@ -130,7 +131,7 @@ jobs:
script: |
echo "Waiting for the application to be healthy on http://api.splanet.co.kr:${NEW_PORT}/actuator/health..."
for i in {1..30}; do
if curl -s http://api.splanet.co.kr:${NEW_PORT}/actuator/health | grep '"status":"UP"' > /dev/null; then
if curl -s http://api.splanet.co.kr:$NEW_PORT/actuator/health | grep '"status":"UP"' > /dev/null; then
echo "Application is healthy and ready to receive traffic."
break
fi
Expand All @@ -140,7 +141,7 @@ jobs:
if [ "$i" -eq 30 ]; then
echo "Application did not start successfully within the expected time."
sudo docker logs splanet_${NEW_VERSION}
sudo docker logs splanet_$NEW_VERSION
exit 1
fi
Expand Down

0 comments on commit 16345a0

Please sign in to comment.