#!/bin/sh
echo ------------------------
echo 停止原来运行中的工程APP NAME=helloworld
tpid= `ps -eflgrep $APP NAMEIgrep -v greplgrep -v killlawk '(print $2)'`
if [ $(tpid) ]; then
echo 'Stop Process..'
kil1 -15 $tpid
fi
sleep 2
tpid=`ps -eflgrep $APP NAMIgrep -v greplgrep -v killlawk '(print $2)'`
1if [ s(tpid) ];then
echo 'Kill Process!'
kill -9 $tpid
else
echo 'stop Success!'
fi
echo 准备从Git仓库拉取最新代码
cd /usr/local/helloworld
echo 开始从Git仓库拉取最新代码
git pull
echo 代码拉取完成
echo 开始打包
output='mvn clean package-Dmaven . test .skip=true'
cd target
echo 启动项目
nohup java -jar helloworld-1.0-SNAPSHOT.jar &> helloworld.log &
echo 项目启动完成