Jenkins 实战部署web 项目
#!/bin/bashsshpass -p "password" scp /data/jenkins/workspace/XXXX/build/libs/qa***.war username@sjqatstXX:/data/qateam/apache-tomcat-7.0.76/webapps;sshpass -p "password" ssh -o StrictHostKeyChecki
(1)官网下载war 包:https://jenkins.io/download/
(2)直接放入Tomcat webapps 进行部署启动
2.设置初始user
3.安装部署项目所需要的插件:
(1)Email 插件:
Email Extension Plugin |
(2)Gradle 插件:
(3)SVN插件:
Subversion Plug-in |
SSH Credentials Plugin |
#!/bin/bashsshpass -p "password" scp /data/jenkins/workspace/XXXX/build/libs/qa***.war username@sjqatstXX:/data/qateam/apache-tomcat-7.0.76/webapps;sshpass -p "password" ssh -o StrictHostKeyChecking=no username@sjqatstXX "sh /data/qateam/apache-tomcat-7.0.76/bin/shutdown.sh;rm -rf /data/qateam/apache-tomcat-7.0.76/webapps/qa***; sh /data/qateam/apache-tomcat-7.0.76/bin/startup.sh";
#!/bin/bash
sshpass -p "password" scp /data/jenkins/workspace/QA***/build/libs/qa***.war username**@sjqatst**:/data/qateam/apache-tomcat-7.0.76/webapps;
sshpass -p "password" ssh -o StrictHostKeyChecking=no username**@sjqatst** "sh /data/qateam/apache-tomcat-7.0.76/bin/shutdown.sh;rm -rf /data/qateam/apache-tomcat-7.0.76/webapps/qa***; sh /data/qateam/apache-tomcat-7.0.76/bin/startup.sh";
(7)点击save 配置完毕
9.配置完成,点击build 开始构建项目
更多推荐
所有评论(0)