Skip to content

Commit d2aeb60

Browse files
committed
[CICD] deploy.sh 추가
1 parent cdc6ec8 commit d2aeb60

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

deploy.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
BUILD_JAR=$(ls /home/ubuntu/app/build/libs/*.jar)
3+
JAR_NAME=$(basename $BUILD_JAR)
4+
echo ">>> build file name: $JAR_NAME" >> /home/ubuntu/app/deploy.log
5+
6+
echo ">>> kill existing process" >> /home/ubuntu/app/deploy.log
7+
PID=$(pgrep -f .jar)
8+
if [ -n "$PID" ]; then
9+
sudo kill -15 $PID
10+
sleep 5
11+
fi
12+
13+
echo ">>> execute new jar file" >> /home/ubuntu/app/deploy.log
14+
cd /home/ubuntu/app
15+
nohup sudo java -jar $BUILD_JAR > /dev/null 2>&1 &

0 commit comments

Comments
 (0)