jenkins配置可执行jar包启动脚本
jar包(snc-businessdata.jar)部署在:/home/domp-product/snc-bizdata/目录,构建工程的时候自动启停脚本如下:cd/home/domp-product/snc-bizdata/pid=`ps -ef| grep snc-businessdata.jar| grep -v "grep"| awk '{print $2}'`if...
·
jar包(snc-businessdata.jar)部署在: /home/domp-product/snc-bizdata/目录,构建工程的时候自动启停脚本如下:
cd /home/domp-product/snc-bizdata/
pid=`ps -ef| grep snc-businessdata.jar| grep -v "grep"| awk '{print $2}'`
if [ -n "${pid}" ];then
echo "Will shutdown snc-businessdata: ${pid}"
kill -9 ${pid}
sleep 2
java -jar snc-businessdata.jar &
new_pid=`ps -ef| grep snc-businessdata.jar| grep -v "grep"| awk '{print $2}'`
if [ -n "${new_pid}" ];then
echo "snc-businessdata has been started.The new pid is ${new_pid}!"
sleep 2
else
echo "snc-businessdata did not start!"
fi
else
echo "No snc-businessdata process! Start in 3 seconds"
sleep 3
java -jar snc-businessdata.jar &
fi
更多推荐
已为社区贡献2条内容
所有评论(0)