安装插件
配置远程机器信息
填写机器ip,输入用户名称和密码,保存远程机器信息
配置项目上传
sh脚本
NAMEDEPLOY='station-new.jar'
NAMEBEFORE='station.jar'
ymd=`date +%Y-%m-%d-%H:%M:%S`;
historyTime=$(date "+%Y-%m-%d-%H:%M:%S" -d '2 month ago')
ID=`ps -ef | grep "$NAMEBEFORE" | grep -v "grep" | awk '{print $2}'`
echo The process pid is $ID
for id in $ID
do
kill -9 $id
echo killed $id
done
mv $NAMEBEFORE $NAMEBEFORE.bak-$ymd
mv $NAMEDEPLOY $NAMEBEFORE
nohup java -Xms128m -Xmx256m -jar $NAMEBEFORE >station.out 2>&1 & tail -n 200 -f station.out
最后一句是项目启动&打印启动日志
|