jenkins中编译中要运行的脚本

2015-09-04  本文已影响56人  中國壹石頭

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

QQ图片20150911100709.jpg
上一篇 下一篇

猜你喜欢

热点阅读