Skip to content

Commit

Permalink
Merge pull request #2 from KUIT-Space/drbug2000-patch-1
Browse files Browse the repository at this point in the history
Create deploy.sh
  • Loading branch information
drbug2000 authored Jul 7, 2024
2 parents fdae494 + 4f5dd3c commit da08273
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
CURRENT_PID=$(pgrep -f .jar)
echo "$CURRENT_PID"
if [ -z $CURRENT_PID ]; then
echo "no process"
else
echo "kill $CURRENT_PID"
kill -9 $CURRENT_PID
sleep 3
fi

JAR_PATH="/home/ubuntu/cicd/*.jar"
echo "jar path : $JAR_PATH"
chmod +x $JAR_PATH
nohup java -jar $JAR_PATH > /dev/null 2> /dev/null < /dev/null &
echo "jar fild deploy success"

0 comments on commit da08273

Please sign in to comment.