BUILD_ID=dontKillMe
rm -fr /home/jenkins/release/${JOB_NAME}/lib
rm -fr /home/jenkins/release/${JOB_NAME}/conf_app
rm -fr /home/jenkins/release/${JOB_NAME}/m10_app_server-0.0.1-SNAPSHOT.jar
mkdir -p /home/jenkins/release/${JOB_NAME}
cp -fr cow-server/m10_app_server/target/m10_app_server-0.0.1-SNAPSHOT.jar /home/jenkins/release/${JOB_NAME}/m10_app_server-0.0.1-SNAPSHOT.jar
cp -fr cow-server/m10_app_server/target/lib /home/jenkins/release/${JOB_NAME}/lib
cd /home/jenkins/release/${JOB_NAME}
/usr/sbin/daemonize -e ddd.log -o ddd.log -c /home/jenkins/release/${JOB_NAME}/ /home/jenkins/release/${JOB_NAME}/restart.sh
pidno=ps -ef | grep -e m10_app_server-0.0.1-SNAPSHOT.jar | grep -v grep | awk '{print $2}'
if [ "$pidno"x = ""x ];
then
echo "server not running"
else
kill -9 $pidno
fi
nohup java -jar m10_app_server-0.0.1-SNAPSHOT.jar -i1 -h192.168.0.113 > server.log &
echo date
- restarting ais>> restart.log
网友评论