25.3 Jenkins部署java项目
我们之前使用jenkins发布了php代码,但这种需求在生产环境中可能用的并不多,用的更多的反而是部署java项目,java的项目是需要编译和打包的。编译和打包用maven完成,所以需要安装maven。
创建私有仓库
首先搭建一个私有仓库,具体步骤可以参考这里:https://blog.csdn.net/miss1181248983/article/details/82598250 ,这里我使用另外一台机器lzx2搭建gitlab服务器,IP是192.168.33.170。
- 环境:
hostname:lzx ip:192.168.33.150 role:jenkins服务器
hostname:lzx1 ip:192.168.33.160 role:部署机器
hostname:lzx2 ip:192.168.33.170 role:gitlab服务器
- lzx2上安装gitlab:
# vim /etc/yum.repos.d/gitlab.repo #写入下面内容
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna./gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
# yum install -y gitlab-ce
# gitlab-ctl reconfigure #自动配置gitlab,这个过程会花费一定时间
# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9100 0.0.0.0:* LISTEN 11845/node_exporter
tcp 0 0 127.0.0.1:9229 0.0.0.0:* LISTEN 12158/gitlab-workho
tcp 0 0 127.0.0.1:9168 0.0.0.0:* LISTEN 12203/ruby
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 11704/unicorn maste
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 11756/nginx: master
tcp 0 0 127.0.0.1:8082 0.0.0.0:* LISTEN 11724/sidekiq 5.1.3
tcp 0 0 127.0.0.1:9236 0.0.0.0:* LISTEN 12173/gitaly
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 785/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1359/master
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 11756/nginx: master
tcp 0 0 127.0.0.1:9121 0.0.0.0:* LISTEN 11955/redis_exporte
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 12216/prometheus
tcp 0 0 127.0.0.1:9187 0.0.0.0:* LISTEN 12247/postgres_expo
tcp 0 0 127.0.0.1:9093 0.0.0.0:* LISTEN 12232/alertmanager
tcp6 0 0 ::1:9168 :::* LISTEN 12203/ruby
tcp6 0 0 :::22 :::* LISTEN 785/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1359/master
tcp6 0 0 :::9094 :::* LISTEN 12232/alertmanager
tcp6 0 0 :::3306 :::* LISTEN 1131/mysqld
# gitlab-ctl status #查看gitlab服务状态
run: alertmanager: (pid 12232) 77s; run: log: (pid 12240) 77s
run: gitaly: (pid 12173) 79s; run: log: (pid 12185) 79s
run: gitlab-monitor: (pid 12203) 79s; run: log: (pid 12206) 78s
run: gitlab-workhorse: (pid 12158) 80s; run: log: (pid 12164) 79s
run: logrotate: (pid 11772) 136s; run: log: (pid 12165) 79s
run: nginx: (pid 11756) 142s; run: log: (pid 12166) 79s
run: node-exporter: (pid 11845) 123s; run: log: (pid 12186) 79s
run: postgres-exporter: (pid 12247) 76s; run: log: (pid 12253) 76s
run: postgresql: (pid 11478) 189s; run: log: (pid 12148) 80s
run: prometheus: (pid 12216) 78s; run: log: (pid 12224) 77s
run: redis: (pid 11403) 195s; run: log: (pid 12149) 80s
run: redis-exporter: (pid 11955) 111s; run: log: (pid 12205) 78s
run: sidekiq: (pid 11724) 151s; run: log: (pid 12151) 80s
run: unicorn: (pid 11681) 157s; run: log: (pid 12193) 79s
gitlab-ctl start 启动gitlab服务
gitlab-ctl stop 关闭gitlab服务
gitlab-ctl restart 重启gitlab服务
安装完gitlab之后,直接在浏览器访问gitlab,输入服务器ip即可(访问之前打开80端口)
提示修改密码,修改完密码后登录(默认用户名是root)
- 创建项目,名字自定义:
- lzx机器上生成公钥,粘贴到SSH Keys:
# ls ~/.ssh
authorized_keys jenkins jenkins.pub known_hosts
# ssh-keygen #生成密钥对
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): #直接按Enter键
Enter passphrase (empty for no passphrase): #直接按Enter键
Enter same passphrase again: #直接按Enter键
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:rKMAgtQMA+Y93mIA3YLJk3zt089oouBCWNiZQTVoVQI root@lzx
The key's randomart image is:
+---[RSA 2048]----+
|*OE**.. |
|*=%..+ |
| BoX. . |
|+ B oo o |
|=. + .. S |
|o+. .. + o |
|o o . = |
|.. o . . |
|. . |
+----[SHA256]-----+
# ls ~/.ssh
authorized_keys id_rsa id_rsa.pub jenkins jenkins.pub known_hosts
# cat ~/.ssh/id_rsa.pub #将公钥粘贴到gitlab页面的SSH Keys中
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGsHhQyJY0yLD667hpzYA/DUH2bqqQpywtRdGU9PHhyiC+UapqjwnosBjnwCopJOaQ4slnn59vO/o6QOFpP6eF0E4327avM15VkObD5fht7S5Q6zfCBcWpoPahsuYDbLqVPUyHqg8jbBB3FDaRiK9EZ1dbvl1Hdzkt6XotjdVdZp1aWQK0LuY1gzf3mouoC9jB9q0whQlLZ40QCe/VrxljGGAtThjD5xAetK/Q0LjOu2u9MyPxtXltO1OacyZxwM1Fjj/p2ce2zw3P+O0Ix8mwzAfMzg+z4Xe85qfNkAySUkP4+Qqkqa348rQ7ryVWG2DYNJbFX3rN1MoWJE6xb2JZ root@lzx
按照这里配置在lzx服务器上执行:
全局设置
# cd /home/
# ls
admin myproject
# git config --global user.name "Administrator"
# git config --global user.email "admin@example.com"
克隆版本库
# git clone git@192.168.33.170:root/test-java.git
Cloning into 'test-java'...
warning: You appear to have cloned an empty repository. #提示似乎克隆了一个空版本库,没关系,因为本来就是空版本库
# ls
admin myproject test-java #多出来test-java目录
创建文件并上传
# cd test-java/
# ls
# touch README.md
# git add !$ #增加
git add README.md
# git commit -m "add README" #提交
[master (root-commit) 6311ae4] add README
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
# git push -u origin master #上传
Counting objects: 3, done.
Writing objects: 100% (3/3), 216 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@192.168.33.170:root/test-java.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
刷新浏览器界面,可以看到刚刚上传的README.md文件
到这里,我们的私有仓库就创建好了。
下载Zrlog源码
ZrLog是使用 Java 开发的博客/CMS程序,具有简约,易用,组件化,内存占用低等特点,自带 Markdown 编辑器。这里我们使用Zrlog的源码作为java代码以作测试。
- lzx上下载zrlog的源码:
# cd ..
# wget https://codeload.github.com/94fzb/zrlog/zip/master #下载zrlog源码包
# du -sh master
30M master
# yum install -y unzip
# unzip master
# ls
admin master myproject test-java zrlog-master
# ls zrlog-master/
bin common data doc LICENSE mvnw mvnw.cmd pom.xml README.en-us.md README.md service web
- 移动到test-java目录:
# mv zrlog-master/* test-java/
mv: overwrite ‘test-java/README.md’? y
# cd test-java/
# ls
bin common data doc LICENSE mvnw mvnw.cmd pom.xml README.en-us.md README.md service web
- 上传到gitlab服务器:
# git add . #增加
# git commit -m "add zrlog" #提交
# git push #上传
Counting objects: 553, done.
Compressing objects: 100% (419/419), done.
Writing objects: 100% (447/447), 1.42 MiB | 0 bytes/s, done.
Total 447 (delta 51), reused 0 (delta 0)
remote: Resolving deltas: 100% (51/51), done.
To git@192.168.33.170:root/test-java.git
ead3e2f..bf720f58 master -> master
刷新浏览器界面,可以看到刚刚上传的zrlog文件
安装tomcat
这里再使用一台机器lzx1安装jdk和tomcat,这里的jdk不能使用openjdk,否则后面会报错。具体安装步骤参考这里:https://blog.csdn.net/miss1181248983/article/details/81080091 。
- 安装jdk:
下载解压
# cd /usr/local/src/
# rz
# ls
jdk-8u181-linux-x64.tar.gz
# tar zxvf jdk-8u181-linux-x64.tar.gz
# mv jdk1.8.0_181/ /usr/local/jdk1.8
设置环境变量
# vim /etc/profile #添加下面内容
JAVA_HOME=/usr/local/jdk1.8/
JAVA_BIN=/usr/local/jdk1.8/bin
JRE_HOME=/usr/local/jdk1.8/jre
PATH=$PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin
CLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.jar
使其生效并检验
# source /etc/profile
# java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
# which java
/usr/local/jdk1.8/bin/java
- 安装tomcat:
下载解压
# wget https://mirrors./apache/tomcat/tomcat-8/v8.5.32/bin/apache-tomcat-8.5.32.tar.gz
# tar zxvf apache-tomcat-8.5.34.tar.gz
# mv apache-tomcat-8.5.34 /usr/local/tomcat
启动tomcat
# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
# netstat -lntp |grep java
tcp6 0 0 :::8080 :::* LISTEN 1181/java
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 1181/java
tcp6 0 0 :::8009 :::* LISTEN 1181/java
设置开机启动
# echo "/usr/local/tomcat/bin/startup.sh" >> /etc/rc.d/rc.local
# chmod a+x /etc/rc.d/rc.local
打开浏览器,输入机器ip:8080
端口访问
我们点击上图中manager webapp
,会发现是403告警,如下图
编辑配置文件
# vim /usr/local/tomcat/webapps/manager/META-INF/context.xml #更改下面内容
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|192.168.33.*" /> #增加一个33网段,让jenkins可以连接tomcat
重启tomcat
# /usr/local/tomcat/bin/shutdown.sh #关闭tomcat
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
# /usr/local/tomcat/bin/startup.sh #启动tomcat
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
刷新tomcat界面,出现一个弹窗,提示输入用户名和密码
增加tomcat用户
# vim /usr/local/tomcat/conf/tomcat-users.xml #在</tomcat-users>这行上面增加下面内容
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user name="admin" password="lzxlzxlzx" roles="admin,manager,admin-gui,admin-script,manager-gui,manag
er-script,manager-jmx,manager-status"/> #增加用户admin,密码为lzxlzxlzx,后面会用到
重启tomcat
# /usr/local/tomcat/bin/shutdown.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
刷新浏览器界面,输入刚增加的用户名和密码,进入tomcat的管理页面
只有jenkins访问到这个后台管理接口才能发布war包。
安装maven
maven用来编译源码并打包,下载地址:http://maven./download.cgi 。
要把maven安装在jenkins机器上,所以得在lzx机器上操作。
- 下载安装:
# cd /usr/local/
# wget http://mirrors./apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
# tar zxvf apache-maven-3.5.4-bin.tar.gz
# /usr/local/apache-maven-3.5.4/bin/mvn --version #查看版本
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
Maven home: /usr/local/apache-maven-3.5.4
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.el7.x86_64", arch: "amd64", family: "unix"
- 配置jenkins:
系统管理
→ 全局工具配置
,找到Maven配置
,默认 settings 提供
选择文件系统中的 settings 文件
,文件路径填写settings文件的路径;默认全局 settings 提供
选择文件系统中的全局 settings 文件
,文件路径填写settings文件的路径。
找到Maven
,点击新增Maven
,自定义名字,取消自动安装
的勾选,路径填写刚刚安装maven的路径,应用保存即可
安装插件
- 先在jenkins界面安装两个插件:
系统管理
→ 管理插件
,安装两个插件:Maven Integration
和Deploy to container
。Maven Integration
这个插件用来构建maven项目,Deploy to container
用来发布war包到远程机器上。
- 安装完插件后,重启jenkins:
# systemctl restart jenkins
- 重新登录jenkins,构建maven项目:
配置maven项目
上面点击确定
之后,jenkins会自动调到项目的配置界面,我们需要进行一些配置。
描述
这里自定义
源码管理
这里选择Git
,然后Repository URL
填写我们搭建的gitlab服务器中版本库的地址,Credentials
选择右边的Add
,添加凭据
类型选择SSH Username with private key
,用户名自定义,私钥这里填写jenkins机器上和gitlab上公钥对应的私钥。
查看jenkins机器和gitlab上公钥对应的私钥(之前克隆版本库时,我们把jenkins机器上的公钥传到了gitlab服务器上)
# cat ~/.ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEAxrB4UMiWNMiw+uu4ac2APw1B9m6qkKcsLUXRlPTx4cogvlGq
ao8J6LAY58AqKSTmkOLJZ5+fbzv6OkDhaT+nhdBON9u2rzNeVZDmw+X4be0uUOs3
wgXFqaD2obLmA2y6lT1Mh6oPI2wQdxQ2kYivRGdXW75dR3c5Lel6LY3VXWadWlkC
tC7mNYM395qLqAvYwfatMIUJS2eNEAnv1a8ZYxhgLU4Yw+cQHrSv0NC4zrtrvTMj
8bV5bTtTmnMmccDNRY4/6dnHts8Nz/jtCMfJsMwHzM4Ps+F3vOanzZAMklJD+PkK
pKmt+PK0O68lVhtg2DSWxV96zdTKFiROsW9iWQIDAQABAoIBAQC1FxpR5sCgk1pb
GIUYSajdzuOUDAGBnhxxlvUSYr4jIOr/C8fbH0vUvMu2TjsfDPbojwsqWx4hb/T9
Ky1HlDDHkbf4yVSUEqmkK1Fosy3eYxKXxgsn18L0fDTN5BQoguz8IMajz6fEjTXk
kpO5yW6VVesVP0gdXtjKs8Ybxu31FXqHXaPb+LFMkLA2MpNxQ8sVNALWSrdGyKA1
bL+It589x1N7NQfNRq1iqCOfipC9VVWTMwHymx0ocIa5ZXurEKNU/FEAW7kso6l6
zuzWpLE1SZZ7TqsW4UlwPWPIZjZ1neh74JlGlXnz29s76Uk1xOrGzCssigE1j6a0
H8hwZ0VBAoGBAOfcg83D5mjhV/BW8teOJskSD3YeK0sVUxigPAnIAzbmPWgys03j
B6NMfI1meNkx7x5sl5+P7dDBOWui2wg4TP3RAlaf1Il93Xy/NW57JxnjH4BY3Yl5
vvR8U0vV0LLcqss7lGuR9OUNi2Nc30cRJB/OOO+enKJPP3QqIe34Gsg1AoGBANtf
3aCgItrONAlinnBrmkxRiJWSjuXBGEg3LRLk0pyJjCfiJ/0L+jVkL/tLwBYGi7pl
IB17N0eOr27/CJK6P4wpPN9X2hqmDoeXgf3Vxuqy+E2f+cEXIG/ftEYwLKkeKGWe
EVWm7pbslCY8cjW8/mIgbZQVyMUOTv7rwjVRA94VAoGBANBCoBkIp0L5dbWpQ8Me
KfRdRooAGz77zoHGG2dlwo1jTTD0qV2CWO/y2cVgj5f3ZCLdw2tNKn1hsaPeygKe
H3m0bPdF5PACoBlW3jV4ZOy5tyffqk27jyunKGJrkWO3Faoqv+vHVEMRYWxElUEO
QnZXE4kX3PVlXUeIOKW5PsUpAoGBALYtyaav9eIRpkM5A+zGX1AL0cqs+ECy99BZ
CfSL1J+s1pj0hlLt1G7scbBWOwHPk9BKVL5G6iRhySz7XIpFY6qpQGUV1wmUZ7KQ
zqIXG2cjE3Oba9S/uO9PLq2vKheT9OZWu3yO8cqiU3HhdtNLzVF+LqHw6VdER7QJ
47FVQ0n1AoGBAKz15tgMf6q58dnpxxY9EwVfNOFiwU9uO48JAQ3dG/kxnA7N2J5m
8lkU7ErL0EFqGhD8uiL8IR3/5mQkYDPreKl4iztonVXexxdNN7HVEAMRYn0a5sGA
yOLSE7HkkS45jeZEGr/JmxVWjbAhAvM4buMYcyAfhqOxIabOIbuXnwxv
-----END RSA PRIVATE KEY-----
我们生成密钥对时没有设置密码,所以Passphrase
可以留空,下面的也留空,点击添加
即可
Credentials
选择Git
,可以发现,之前的红色提示没有了,说明没问题
构建触发器
、构建环境
、Pre Steps
部分全部保持默认;Build
下面Root POM
为 pom.xml,Goals and options
填写clean install -D maven.test.skip=true
;Post Steps
、构建设置
部分保持默认;
点击增加构建后操作步骤
,选择Deploy war/ear to a container
,WAR/EAR files
填写**/*.war
,表示全部的war包;Contex path
留空;Containers
选择 Tomcat 8.x ,Tomcat URL
填写我们安装tomcat服务器的地址,我的是http://192.168.33.160:8080
Credentials
点击Add
,用户名这里填admin,密码填lzxlzxlzx,这里的用户名密码就是登录tomcat后台管理入口的账号密码,其它保持默认,添加
即可
然后Credentials
这里选择admin/******
继续点击增加构建后操作步骤
,选择Editable Email Notification
,Project Recipient List
这里添加自己的邮箱,用英文逗号分隔,其它位置保持默认
然后点击Advanced Setting
,定位到Triggers
,可以在Add Trigger
处增加发邮件的条件,这里如果是Always就可以了
最后点击应用、保存即可。
立即构建
上面配置完后,我们开始构建。点击立即构建
然后我们在构建历史下面选中#1
,下拉点击控制台输出
,可以看到我们刚刚构建的输出内容
第一次构建时会稍慢,因为会下载很多和maven相关的东西,查看到最后结果,这里有报错
查看邮箱邮件
回到lzx机器上,安装jdk:
因为之前安装tomcat时lzx1机器上有安装jdk,所以我这里可以直接从lzx1拷到lzx上
# scp -r 192.168.33.160:/usr/local/jdk1.8 /usr/local/jdk1.8
root@192.168.33.160's password: #输入密码
# /usr/local/jdk1.8/bin/java -version #查看版本
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
回到jenkins界面,回到首页,点击系统设置
→ 全局工具配置
→ JDK
,别名自定义,然后路径填刚刚安装jdk的路径,然后应用、保存即可
重启jenkins服务:
# systemctl restart jenkins
重新登录jenkins界面,回到java-test,再次构建,查看控制台输出
查看邮箱邮件
反复修改一些东西后试了几次,发现还是有问题。于是我重新更换zrlog的版本做测试(最先我用的是zrlog-2.0.6版本,然后换成了zrlog-1.8.0版本)
# cd ..
# wget https://github.com/redhatxl/zrlog/archive/master.zip
# du -sh master.zip
1.6M master.zip
# yum install -y unzip
# unzip master
# ls
admin master master.zip myproject test-java zrlog-master
# ls zrlog-master/
bin CHANGELOG.md doc LICENSE mvnw mvnw.cmd pom.xml README.md src
# mv zrlog-master/* test-java/
mv: overwrite ‘test-java/README.md’? y
# cd test-java/
# ls
bin CHANGELOG.md doc LICENSE mvnw mvnw.cmd pom.xml README.md src
上传到gitlab服务器上
再次构建,还是遇到和之前一样的问题
到网上搜了一下报错信息,都说是tomcat内存溢出导致自动部署失败,修改内存的值之后继续构建,还是报一样的错。
我尝试去查看tomcat服务器上的webapps目录
# cd /usr/local/tomcat/
# ls webapps/
docs examples host-manager manager ROOT zrlog-1.8.0 zrlog-1.8.0.war zrlog-2.0.6 zrlog-2.0.6.war #这里多出来我之前两次实验的zrlog的war包
刷新tomcat的后台管理页面
发现多出来zrlog1.8.0和zrlog2.0.6
lzx1上删除这两个war包及其解压文件
# cd webapps/
# rm -rf zrlog-*
# ls
docs examples host-manager manager ROOT
再次在jenkins界面构建,还是和之前一样的报错
查看webapps
zrlog1.8版本的war包又出现了
刷新tomcat的后台管理页面
只有zrlog1.8.0
至此,jenkins虽然部署到能把war包发布webapps目录下,但是由于不知名原因,jenkins一直有报错,而且war运行不起来,望知道原因的大佬给个回复,有时间我会在尝试弄弄。
更多资料参考: