#!/bin/sh
#获取tomcat的PID
tomcat_pid=`ps | grep "tomcat" | head -n 1 | awk '{print $1}'`
#判断tomcat是否结束,未结束则kill掉
if [ -z $tomcat_pid ] ; then
echo "tomcat starts yet"
else
kill $tomcat_pid
fi
#删除tomcat下发布的项目
rm -rf /Users/nianjun/Work/workspace/rsjf-manager/ROOT*
rm -rf /Users/nianjun/Work/tools/apache-tomcat-8.0.35/webapps/ROOT*
cd /Users/nianjun/Work/workspace/rsjf-manager
mvn clean install -Dmaven.test.skip -U
cp /Users/nianjun/Work/workspace/rsjf-manager/target/ROOT.war /Users/nianjun/Work/tools/apache-tomcat-8.0.35/webapps
cd /Users/nianjun/Work/tools/apache-tomcat-8.0.35/bin
sh startup.sh