Skip to content

Commit

Permalink
๐Ÿ“docs : deploy.sh ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
DDonghyeo committed May 23, 2024
1 parent 5532fe8 commit 1f16faf
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions script/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,19 @@
#!/bin/bash
#์…”๋ฑ…(shebang)

# ์ž…๋ ฅ๋ฐ›์€ ์„œ๋น„์Šค ์ด๋ฆ„
SERVICE_NAME=$1

# ์„œ๋น„์Šค ์ด๋ฆ„์— ๋”ฐ๋ผ ๋ฐฐํฌํ•  ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ ์„ค์ •
case "$SERVICE_NAME" in
"api-gateway")
TARGET_SERVICE="api-gateway"
;;
"noti-service")
TARGET_SERVICE="noti-service"
;;
"user-service")
TARGET_SERVICE="user-service"
;;
"weather-service")
TARGET_SERVICE="weather-service"
;;
"all")
TARGET_SERVICE="api-gateway noti-service user-service weather-service"
;;
*)
echo "Invalid service name: $SERVICE_NAME"
exit 1
;;
esac

# ํƒ€๊ฒŸ ์„œ๋น„์Šค ์žฌ๋ฐฐํฌ ์‹œ์ž‘
echo "$TARGET_SERVICE Deploy..."
#echo "$TARGET_SERVICE Deploy..."
# docker compose ๋ฅผ ์‹คํ–‰ํ•จ.
# -f ์˜ต์…˜ : docker-compose ๋ช…๋ น์—์„œ ์‚ฌ์šฉํ•  compose ํŒŒ์ผ์˜ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •. (file)
# up : docker-compose ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์‹œ์ž‘ํ•˜๋Š” ๋ช…๋ น. ์ง€์ •๋œ ์„œ๋น„์Šค์˜ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋นŒ๋“œ, ์ƒ์„ฑ ๋ฐ ์‹œ์ž‘ (๋ฒ„์ „ ์ตœ์‹ ํ™”)
# -d : detached ๋ชจ๋“œ. ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋ฐฑ๊ทธ๋ผ์šด๋“œ์—์„œ ์‹คํ–‰
docker compose -f /home/docker-compose.yml up -d $TARGET_SERVICE

echo "api-gateway server start..."
docker compose -f /home/docker-compose.yml up -d api-gateway
echo "noti-service server start..."
docker compose -f /home/docker-compose.yml up -d noti-service
echo "user-service server start..."
docker compose -f /home/docker-compose.yml up -d user-service
echo "weather-service server start..."
docker compose -f /home/docker-compose.yml up -d weather-service

0 comments on commit 1f16faf

Please sign in to comment.