Skip to content

Commit bc46a83

Browse files
committed
fix: CodeDeploy 실행 시 spring profile 하드코딩 제거
1 parent d805a83 commit bc46a83

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

scripts/deploy.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ set -e # 에러 발생 시 스크립트 중단
44

55
REPOSITORY=/home/ubuntu/app
66
LOG_FILE=$REPOSITORY/deploy.log
7+
8+
# 환경 변수 로드
9+
log "> 환경 변수 로드"
10+
source ~/.bashrc
11+
712
SPRING_PROFILE=${SPRING_PROFILE:-prod}
813
PORT=${PORT:-8080}
914

@@ -14,10 +19,6 @@ log() {
1419

1520
log "=== 배포 시작 ==="
1621

17-
# 환경 변수 로드
18-
log "> 환경 변수 로드"
19-
source ~/.bashrc
20-
2122
log "> PROFILE=$SPRING_PROFILE / PORT=$PORT"
2223

2324
# 현재 구동 중인 애플리케이션 pid 확인
@@ -53,7 +54,7 @@ chmod +x $JAR_NAME
5354
# 애플리케이션 실행
5455
log "> $JAR_NAME 실행 (spring.profiles.active=$SPRING_PROFILE)"
5556
nohup java -jar \
56-
-Dspring.profiles.active=prod \
57+
-Dspring.profiles.active=$SPRING_PROFILE \
5758
-Duser.timezone=Asia/Seoul \
5859
-Xms512m \
5960
-Xmx1024m \

0 commit comments

Comments
 (0)