Skip to content

Commit a9522f4

Browse files
committed
Merge branch 'hotfix/v1.0.2'
2 parents 2574e54 + 7c1b368 commit a9522f4

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

appspec.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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

deploy.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 &

0 commit comments

Comments
 (0)