Skip to content

Commit c016d50

Browse files
committed
[infra] deploy ์ˆ˜์ •
1 parent f95e63a commit c016d50

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

โ€Ž.idea/workspace.xmlโ€Ž

Lines changed: 18 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

โ€Ždeploy.shโ€Ž

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
#!/bin/bash
22
set -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

512
APP_NAME="moviezip-app"
613
IMAGE_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 ๋นŒ๋“œ
1216
echo "Building Docker image..."
1317
docker build -t ${IMAGE_NAME} /home/ec2-user/app
1418

15-
# Blue/Green ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ ๋ฐ ํฌํŠธ ์„ค์ •
19+
# Blue/Green ์ปจํ…Œ์ด๋„ˆ ์ด๋ฆ„ ๋ฐ ํฌํŠธ
1620
BLUE_NAME="${APP_NAME}-blue"
1721
GREEN_NAME="${APP_NAME}-green"
1822
BLUE_PORT=8081
1923
GREEN_PORT=8082
2024

21-
# ํ˜„์žฌ ์‹คํ–‰ ์ค‘์ธ Blue/Green ํ™•์ธ
25+
# ์‹คํ–‰ ์ค‘์ธ ์ปจํ…Œ์ด๋„ˆ ํ™•์ธ
2226
RUNNING_BLUE=$(docker ps --filter "name=${BLUE_NAME}" -q)
2327
RUNNING_GREEN=$(docker ps --filter "name=${GREEN_NAME}" -q)
2428

@@ -57,5 +61,3 @@ sleep 10
5761
docker image prune -af
5862

5963
echo "Deployment completed!"
60-
echo "Blue ๋กœ๊ทธ: ${LOG_DIR}/blue.log"
61-
echo "Green ๋กœ๊ทธ: ${LOG_DIR}/green.log"

0 commit comments

Comments
ย (0)