Centos 7.5 tomcat 7 openjdk 1.8.0 maven 3.5.4 Jenkins主機:192.168.1.5 tomcat主機:192.168.1.6
具體操做參考:Gitlab+Jenkins實現自動部署java
#在Jenkins機器上操做 #下載JDK和Maven wget https://download.java.net/java/jdk8u192/archive/b02/binaries/jdk-8u192-ea-bin-b02-linux-x64-19_jul_2018.tar.gz wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz tar -xf jdk-8u192-ea-bin-b02-linux-x64-19_jul_2018.tar.gz -C /usr/local tar -xf apache-maven-3.5.4-bin.tar.gz -C /usr/local cd /usr/local ln -s jdk1.8.0_192/ java ln -s apache-maven-3.5.4 maven
首先咱們要配置好Jenkins編譯所須要的JDK和Maven
linux
#克隆剛纔咱們建立的空項目 cd /root git clone git@192.168.0.172:yfg/tomcat.git #下載一份solo博客的項目代碼 wget https://github.com/b3log/solo/archive/master.zip unzip master.zip cp -a solo-master/* tomcat/ cd tomcat/ git add . git commit -am 'test commit' git checkout master git push --all #檢查一下代碼倉庫是否已經有剛纔咱們上傳的代碼
回到Jenkins,點擊開始構建git