Skip to content

Commit 86d2d3d

Browse files
committed
배포
1 parent 7f05f1d commit 86d2d3d

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

appspec.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 0.0
2+
os: linux
3+
4+
files:
5+
- source: /
6+
destination: /home/ubuntu/GLOG
7+
permissions:
8+
- object: /home/ubuntu/GLOG/
9+
owner: ubuntu
10+
group: ubuntu
11+
hooks:
12+
AfterInstall:
13+
- location: scripts/deploy.sh
14+
timeout: 60
15+
runas: ubuntu

scritps/deploy.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
REPOSITORY=/home/ubuntu/GLOG
4+
cd $REPOSITORY
5+
6+
APP_NAME=moduform
7+
JAR_NAME=$(ls $REPOSITORY/build/libs/ | grep 'SNAPSHOT.jar' | tail -n 1)
8+
JAR_PATH=$REPOSITORY/build/libs/$JAR_NAME
9+
10+
CURRENT_PID=$(pgrep -f $APP_NAME)
11+
12+
if [ -z $CURRENT_PID ]
13+
then
14+
echo "> 종료할 애플리케이션이 없습니다."
15+
else
16+
echo "> kill -9 $CURRENT_PID"
17+
kill -15 $CURRENT_PID
18+
sleep 5
19+
fi
20+
21+
echo "> Deploy - $JAR_PATH "
22+
nohup java -jar $JAR_PATH > /dev/null 2> /dev/null < /dev/null &

0 commit comments

Comments
 (0)