File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ version : 0.0
2+ os : linux
3+ files :
4+ - source : /
5+ destination : /home/ubuntu/app/
6+ overwrite : yes
7+
8+ permissions :
9+ - object : /
10+ pattern : " **"
11+ owner : ubuntu
12+ group : ubuntu
13+
14+ hooks :
15+ ApplicationStart :
16+ - location : deploy.sh
17+ timeout : 60
18+ runas : ubuntu
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ REPOSITORY=/home/ubuntu/app
4+
5+ echo " > 현재 구동 중인 애플리케이션 pid 확인"
6+
7+ CURRENT_PID=$( pgrep -fla java)
8+
9+ echo " 현재 구동 중인 애플리케이션 pid: $CURRENT_PID "
10+
11+ if [ -z " $CURRENT_PID " ]; then
12+ echo " 현재 구동 중인 애플리케이션이 없으므로 종료하지 않습니다."
13+ else
14+ echo " > kill -15 $CURRENT_PID "
15+ kill -15 $CURRENT_PID
16+ sleep 5
17+ fi
18+
19+ echo " > 새 애플리케이션 배포"
20+
21+ JAR_NAME=$( ls -tr $REPOSITORY /* SNAPSHOT.jar | tail -n 1)
22+
23+ echo " > JAR NAME: $JAR_NAME "
24+
25+ echo " > $JAR_NAME 에 실행권한 추가"
26+
27+ chmod +x $JAR_NAME
28+
29+ echo " > $JAR_NAME 실행"
30+
31+ nohup java -jar -Duser.timezone=Asia/Seoul $JAR_NAME >> $REPOSITORY /nohup.out 2>&1 &
You can’t perform that action at this time.
0 commit comments