File tree Expand file tree Collapse file tree 2 files changed +28
-25
lines changed
Expand file tree Collapse file tree 2 files changed +28
-25
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4+ # ๋ก๊ทธ ํ์ผ ์์ฑ
5+ LOG_DIR=" /home/ec2-user/app/logs"
6+ mkdir -p ${LOG_DIR}
7+ exec > >( tee -i ${LOG_DIR} /deploy.log)
8+ exec 2>&1
9+
10+ echo " Starting deployment..."
411
512APP_NAME=" moviezip-app"
613IMAGE_NAME=" moviezip-server:latest"
7- LOG_DIR=" /home/ec2-user/app/logs"
8-
9- mkdir -p ${LOG_DIR}
1014
11- # Docker build (JAR ํฌํจ)
15+ # Docker ๋น๋
1216echo " Building Docker image..."
1317docker build -t ${IMAGE_NAME} /home/ec2-user/app
1418
15- # Blue/Green ์ปจํ
์ด๋ ์ด๋ฆ ๋ฐ ํฌํธ ์ค์
19+ # Blue/Green ์ปจํ
์ด๋ ์ด๋ฆ ๋ฐ ํฌํธ
1620BLUE_NAME=" ${APP_NAME} -blue"
1721GREEN_NAME=" ${APP_NAME} -green"
1822BLUE_PORT=8081
1923GREEN_PORT=8082
2024
21- # ํ์ฌ ์คํ ์ค์ธ Blue/Green ํ์ธ
25+ # ์คํ ์ค์ธ ์ปจํ
์ด๋ ํ์ธ
2226RUNNING_BLUE=$( docker ps --filter " name=${BLUE_NAME} " -q)
2327RUNNING_GREEN=$( docker ps --filter " name=${GREEN_NAME} " -q)
2428
@@ -57,5 +61,3 @@ sleep 10
5761docker image prune -af
5862
5963echo " Deployment completed!"
60- echo " Blue ๋ก๊ทธ: ${LOG_DIR} /blue.log"
61- echo " Green ๋ก๊ทธ: ${LOG_DIR} /green.log"
You canโt perform that action at this time.
0 commit comments