We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cdc6ec8 commit d2aeb60Copy full SHA for d2aeb60
1 file changed
deploy.sh
@@ -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