Jenkins 自动部署

Jenkins 服务搭建 【略】

直接展示配置

1,服务搭建好后的界面:


一,新建项目,点击新建后就界面


点击3 确定,进入

1, General


2,源码管理


3,构建触发器


4,构建环境Pre Steps、Build


5,构建设置、构建后操作


注意tomcat重启脚本

1,jenkin 中Exec command 执行文件复制并进行重启如下

 cp /root/apache-tomcat-x.x.x/webapps/target/*.war /root/apache-tomcat-x.x.x/webapps/ROOT.war

/root/apache-tomcat-x.x.x/shellrestart restart

重启脚本:shellrestart

#!/bin/sh

# description: Auto-starts tomcat
# processname: shellrestart
case $1 in
start)
sh /root/apache-tomcat-8.x.xx/bin/startup.sh
;;
stop)
sh /root/apache-tomcat-8.x.xx/bin/shutdown.sh
;;
restart)
sh /root/apache-tomcat-8.x.xx/bin/shutdown.sh
sh /root/apache-tomcat-8.x.xx/bin/startup.sh
;;
esac
exit 0

到此 game over!


发布了45 篇原创文章 · 获赞 3 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/cfm_gavin/article/details/79884891