基於私服nexus和jenkins搭建快嘉開發框架1.1環境

參考快嘉開發框架1.1和示例介紹及使用說明html

###基本環境準備 一、服務器A(192.168.9.1)搭建私服Nexus Repository Manager OSS,其版本號2.13.0-01:
輸入圖片說明
二、服務器B(192.168.9.2)搭建Jenkins,其版本號1.638:
輸入圖片說明
三、jenkins安裝插件TestNG Results Plugin
四、服務器B上部署maven、版本號3.3.9,其中maven中mirror指向服務器A搭建的私服地址
五、服務器B上/etc/hosts中配置項mysql

192.168.9.1    www.mycompany.com

六、服務器C(192.168.9.3)參考以下博客搭建mysql、redis 、rabbitmq,另外參考官方文檔搭建activemq5.13.1。linux

七、準備服務器D(192.168.9.4)用來部署demo-Rest、demo-Web和demo-Batch,服務器D上部署jdk1.7.0_75,tomcat8.0.35
八、服務器D上/etc/hosts中配置項redis

192.168.9.3    mysqlhost
192.168.9.3    rabbitmqhost
192.168.9.3    activemqhost
192.168.9.3    redishost

九、參考以下博客對服務器B配置免登錄ssh到服務器D
使用 RSA 密鑰對進行 SSH 登陸驗證sql

###jenkins中配置ciHelper,deploy到私服,截圖以下 輸入圖片說明 輸入圖片說明
執行該任務,輸出以下tomcat

[INFO] Reactor Summary:
[INFO] 
[INFO] cihelper-parent .................................... SUCCESS [  1.192 s]
[INFO] base-test .......................................... SUCCESS [  3.801 s]
[INFO] base-common ........................................ SUCCESS [  3.315 s]
[INFO] MybatisEx .......................................... SUCCESS [  1.637 s]
[INFO] thirdparty ......................................... SUCCESS [  1.855 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.762 s
[INFO] Finished at: 2016-08-21T22:06:08+08:00
[INFO] Final Memory: 27M/167M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/base-test/pom.xml to com.fastjrun.share/base-test/1.1/base-test-1.1.pom
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/base-test/target/base-test-1.1.jar to com.fastjrun.share/base-test/1.1/base-test-1.1.jar
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/base-test/target/base-test-1.1-sources.jar to com.fastjrun.share/base-test/1.1/base-test-1.1-sources.jar
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/pom.xml to com.fastjrun.share/cihelper-parent/1.1/cihelper-parent-1.1.pom
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/thirdparty/pom.xml to com.fastjrun/thirdparty/1.1/thirdparty-1.1.pom
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/thirdparty/target/thirdparty.jar to com.fastjrun/thirdparty/1.1/thirdparty-1.1.jar
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/MybatisEx/pom.xml to com.fastjrun/MybatisEx/1.1/MybatisEx-1.1.pom
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/MybatisEx/target/MybatisEx-1.1.jar to com.fastjrun/MybatisEx/1.1/MybatisEx-1.1.jar
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/MybatisEx/target/MybatisEx-1.1-sources.jar to com.fastjrun/MybatisEx/1.1/MybatisEx-1.1-sources.jar
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/base-common/pom.xml to com.fastjrun.share/base-common/1.1/base-common-1.1.pom
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/base-common/target/base-common-1.1.jar to com.fastjrun.share/base-common/1.1/base-common-1.1.jar
[JENKINS] Archiving /root/.jenkins/workspace/ciHelper1.1/base-common/target/base-common-1.1-sources.jar to com.fastjrun.share/base-common/1.1/base-common-1.1-sources.jar
channel stopped
Finished: SUCCESS

###jenkins中配置demo-parent,deploy到私服,截圖以下 輸入圖片說明 輸入圖片說明
執行該任務,任務以下服務器

[INFO] Reactor Summary:
[INFO] 
[INFO] demoSpring4-parent ................................. SUCCESS [  2.326 s]
[INFO] demoSpring4-base ................................... SUCCESS [  4.056 s]
[INFO] demoSpring4-util ................................... SUCCESS [  4.394 s]
[INFO] demoSpring4-bundle ................................. SUCCESS [  1.404 s]
[INFO] demoSpring4-persistence-impl ....................... SUCCESS [  2.034 s]
[INFO] demoSpring4-service-impl ........................... SUCCESS [  3.335 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.335 s
[INFO] Finished at: 2016-08-21T22:10:33+08:00
[INFO] Final Memory: 41M/301M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Service-Impl/pom.xml to com.fastjrun.share/demoSpring4-service-impl/1.1-SNAPSHOT/demoSpring4-service-impl-1.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Service-Impl/target/demoSpring4-service-impl-1.1-SNAPSHOT.jar to com.fastjrun.share/demoSpring4-service-impl/1.1-20160821.141032-1/demoSpring4-service-impl-1.1-20160821.141032-1.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Service-Impl/target/demoSpring4-service-impl-1.1-SNAPSHOT-sources.jar to com.fastjrun.share/demoSpring4-service-impl/1.1-20160821.141032-1/demoSpring4-service-impl-1.1-20160821.141032-1-sources.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/pom.xml to com.fastjrun.share/demoSpring4-parent/1.1-SNAPSHOT/demoSpring4-parent-1.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Base/pom.xml to com.fastjrun.share/demoSpring4-base/1.1-SNAPSHOT/demoSpring4-base-1.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Base/target/demoSpring4-base-1.1-SNAPSHOT.jar to com.fastjrun.share/demoSpring4-base/1.1-20160821.141020-1/demoSpring4-base-1.1-20160821.141020-1.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Base/target/demoSpring4-base-1.1-SNAPSHOT-sources.jar to com.fastjrun.share/demoSpring4-base/1.1-20160821.141020-1/demoSpring4-base-1.1-20160821.141020-1-sources.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Bundle/pom.xml to com.fastjrun.share/demoSpring4-bundle/1.1-SNAPSHOT/demoSpring4-bundle-1.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Bundle/target/demoSpring4-bundle-1.1-SNAPSHOT.jar to com.fastjrun.share/demoSpring4-bundle/1.1-20160821.141026-1/demoSpring4-bundle-1.1-20160821.141026-1.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Bundle/target/demoSpring4-bundle-1.1-SNAPSHOT-sources.jar to com.fastjrun.share/demoSpring4-bundle/1.1-20160821.141026-1/demoSpring4-bundle-1.1-20160821.141026-1-sources.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Util/pom.xml to com.fastjrun.share/demoSpring4-util/1.1-SNAPSHOT/demoSpring4-util-1.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Util/target/demoSpring4-util-1.1-SNAPSHOT.jar to com.fastjrun.share/demoSpring4-util/1.1-20160821.141024-1/demoSpring4-util-1.1-20160821.141024-1.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Util/target/demoSpring4-util-1.1-SNAPSHOT-sources.jar to com.fastjrun.share/demoSpring4-util/1.1-20160821.141024-1/demoSpring4-util-1.1-20160821.141024-1-sources.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Persistence-Impl/pom.xml to com.fastjrun.share/demoSpring4-persistence-impl/1.1-SNAPSHOT/demoSpring4-persistence-impl-1.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Persistence-Impl/target/demoSpring4-persistence-impl-1.1-SNAPSHOT.jar to com.fastjrun.share/demoSpring4-persistence-impl/1.1-20160821.141028-1/demoSpring4-persistence-impl-1.1-20160821.141028-1.jar
[JENKINS] Archiving /root/.jenkins/workspace/demo-parent/Persistence-Impl/target/demoSpring4-persistence-impl-1.1-SNAPSHOT-sources.jar to com.fastjrun.share/demoSpring4-persistence-impl/1.1-20160821.141028-1/demoSpring4-persistence-impl-1.1-20160821.141028-1-sources.jar
channel stopped
Finished: SUCCESS

###jenkins中配置demo-Rest-config,將config.tar.gz直接scp到服務器D(192.168.9.4),截圖以下 輸入圖片說明 輸入圖片說明
執行該任務,成功後可ssh到服務器D(192.168.9.3)在目錄/app/demoSpring4/Rest下解壓config.tar.gzapp

tar -zxvf config.tar.gz

###jenkins中配置demo-Rest,將demo-Rest.war直接scp到服務器D(192.168.9.4)的tomcat下,截圖以下 輸入圖片說明 輸入圖片說明 執行該任務,成功後後服務器D(192.168.9.3)的tomcat會從新部署demo-Rest.war框架

###參考demo-Rest-config配置demo-Web-config ###參考demo-Web-config配置demo-Webssh

###jenkins中配置demo-Batch,將batch.tar.gz直接scp到服務器D(192.168.9.4),截圖以下
輸入圖片說明 輸入圖片說明 輸入圖片說明 執行該任務,成功後可ssh到服務器D(192.168.9.4)在目錄/app/demoSpring4下解壓batch.tar.gz

tar -zxvf batch.tar.gz
cd batch
nohup ./startup.sh

###示例環境

###使用jenkins配置rest-test任務,可造成testng報告以下 輸入圖片說明

相關文章
相關標籤/搜索