if [ -n "$1" ] ;then
echo "the word you input is $1"
else
echo "请输入要发布的git分支,例如: sh develop_project.sh dev"
exit
fi
cd /home/cube/workspace/java_project/spap_cards
git checkout $1
git pull
mvn clean package -Dmaven.test.skip=true
cd target/
PIDS=`ps -ef | grep xxxx.jar | grep -v grep | awk '{print $2
}'`
echo $PIDS
if [ "$PIDS" != "" ]; then
echo $PIDS
kill -9 $PIDS
echo "app restart!"
else
echo "app started"
fi
rm -rf /home/xxx.jar
cp /home/2/spap_cards-1.0-SNAPSHOT.jar /home
sh /home/run.sh
exit