Skip to content

Commit

Permalink
๐Ÿ› bugfix: Docker Container๋ช… ๋ณ€๊ฒฝ #121
Browse files Browse the repository at this point in the history
  • Loading branch information
jun02160 committed Mar 2, 2024
1 parent 7e4b108 commit f9e7cf5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions scripts/api/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ if [ -z "$IS_REDIS_ACTIVATE" ];then
fi

# ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ ํ™•์ธ
if [ ${RUNNING_CONTAINER_NAME} == "blue" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: blue (:8080)"
if [ ${RUNNING_CONTAINER_NAME} == "blue-api" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: blue-api (:8080)"
RUNNING_SERVER_PORT=8080
elif [ ${RUNNING_CONTAINER_NAME} == "green" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: green (:8082)"
elif [ ${RUNNING_CONTAINER_NAME} == "green-api" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: green-api (:8082)"
RUNNING_SERVER_PORT=8082
else
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: ์—†์Œ"
Expand Down Expand Up @@ -90,7 +90,7 @@ if [ -z $IS_GREEN_ACTIVATE ]; then
sudo nginx -s reload
echo "[$NOW_TIME] ์Šค์œ„์นญ ํ›„ ์‹คํ–‰ ์ค‘์ธ Port: $(sudo cat /etc/nginx/conf.d/service-url.inc)"
echo "[$NOW_TIME] Blue ์ปจํ…Œ์ด๋„ˆ ์ค‘๋‹จ"
docker-compose stop blue
docker-compose stop blue-api

# Blue Up
else
Expand All @@ -100,9 +100,9 @@ else
CURRENT_SERVER_PORT=8080

echo "[$NOW_TIME] Blue ๋„์ปค ์ด๋ฏธ์ง€ pull"
docker-compose pull blue
docker-compose pull blue-api
echo "[$NOW_TIME] Blue ์ปจํ…Œ์ด๋„ˆ Up (๋นŒ๋“œ & ์‹คํ–‰)"
docker-compose up -d blue
docker-compose up -d blue-api
echo "[$NOW_TIME] 10์ดˆ ํ›„ Health Check ์‹œ์ž‘"
sleep 10

Expand Down Expand Up @@ -137,7 +137,7 @@ else
sudo nginx -s reload
echo "[$NOW_TIME] ์Šค์œ„์นญ ํ›„ ์‹คํ–‰ ์ค‘์ธ Port: $(sudo cat /etc/nginx/conf.d/service-url.inc)"
echo "[$NOW_TIME] Green ์ปจํ…Œ์ด๋„ˆ ์ค‘๋‹จ"
docker-compose stop green
docker-compose stop green-api
fi

echo "----------------------------------------------------------------------"
Expand Down
20 changes: 10 additions & 10 deletions scripts/batch/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ if [ -z "$IS_REDIS_ACTIVATE" ];then
fi

# ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ ํ™•์ธ
if [ ${RUNNING_CONTAINER_NAME} == "blue" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: blue (:8081)"
if [ ${RUNNING_CONTAINER_NAME} == "blue-batch" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: blue-batch (:8081)"
RUNNING_SERVER_PORT=8081
elif [ ${RUNNING_CONTAINER_NAME} == "green" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: green (:8083)"
elif [ ${RUNNING_CONTAINER_NAME} == "green-batch" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: green-batch (:8083)"
RUNNING_SERVER_PORT=8083
else
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: ์—†์Œ"
Expand All @@ -54,9 +54,9 @@ if [ -z $IS_GREEN_ACTIVATE ]; then
CURRENT_SERVER_PORT=8083

echo "[$NOW_TIME] Green ๋„์ปค ์ด๋ฏธ์ง€ pull"
docker-compose pull green
docker-compose pull green-batch
echo "[$NOW_TIME] Green ์ปจํ…Œ์ด๋„ˆ Up (๋นŒ๋“œ & ์‹คํ–‰)"
docker-compose up -d green
docker-compose up -d green-batch
echo "[$NOW_TIME] 10์ดˆ ํ›„ Health Check ์‹œ์ž‘"
sleep 10

Expand Down Expand Up @@ -90,7 +90,7 @@ if [ -z $IS_GREEN_ACTIVATE ]; then
sudo nginx -s reload
echo "[$NOW_TIME] ์Šค์œ„์นญ ํ›„ ์‹คํ–‰ ์ค‘์ธ Port: $(sudo cat /etc/nginx/conf.d/service-url-batch.inc)"
echo "[$NOW_TIME] Blue ์ปจํ…Œ์ด๋„ˆ ์ค‘๋‹จ"
docker-compose stop blue
docker-compose stop blue-batch

# Blue Up
else
Expand All @@ -100,9 +100,9 @@ else
CURRENT_SERVER_PORT=8081

echo "[$NOW_TIME] Blue ๋„์ปค ์ด๋ฏธ์ง€ pull"
docker-compose pull blue
docker-compose pull blue-batch
echo "[$NOW_TIME] Blue ์ปจํ…Œ์ด๋„ˆ Up (๋นŒ๋“œ & ์‹คํ–‰)"
docker-compose up -d blue
docker-compose up -d blue-batch
echo "[$NOW_TIME] 10์ดˆ ํ›„ Health Check ์‹œ์ž‘"
sleep 10

Expand Down Expand Up @@ -137,7 +137,7 @@ else
sudo nginx -s reload
echo "[$NOW_TIME] ์Šค์œ„์นญ ํ›„ ์‹คํ–‰ ์ค‘์ธ Port: $(sudo cat /etc/nginx/conf.d/service-url-batch.inc)"
echo "[$NOW_TIME] Green ์ปจํ…Œ์ด๋„ˆ ์ค‘๋‹จ"
docker-compose stop green
docker-compose stop green-batch
fi

echo "----------------------------------------------------------------------"
Expand Down

0 comments on commit f9e7cf5

Please sign in to comment.