Skip to content

Instantly share code, notes, and snippets.

@lhcpig
Last active April 14, 2017 09:12
Show Gist options
  • Save lhcpig/a3813a6dcdd8546b2581905d6bb29775 to your computer and use it in GitHub Desktop.
Save lhcpig/a3813a6dcdd8546b2581905d6bb29775 to your computer and use it in GitHub Desktop.
jenkins 部署spring-boot应用
#!/bin/sh
nohup /usr/bin/java -jar $1 >> $2 &
#!/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