diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 00000000..73550136 --- /dev/null +++ b/deploy.sh @@ -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"