-
-
Save youzipi/44e4e49e08caa6f35197d7fe2551649e to your computer and use it in GitHub Desktop.
jenkins 部署spring-boot应用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
nohup /usr/bin/java -jar $1 >> $2 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pid=`/usr/sbin/lsof -i:$1 | grep java | awk '{print $2}'` | |
if test -z "$pid" | |
then | |
echo 'api has not been started' | |
echo 'skip kill it' | |
else | |
echo "kill $pid" | |
kill -9 $pid | |
sleep 5 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment