Jenkins技巧:如何更新Jenkins到最新版本

-----------------------------------------------------------------

原创博文,未经作者允许禁止转载。

博主:疲惫的豆豆

链接:http://www.cnblogs.com/dzblog/p/6962000.html

----------------------------------------------------------------

更新:

2017-06-19:因个人需要替换成最新的weekly版本,确保操作步骤没问题。

 

背景


接手一个前人维护的Jenkins系统,使用的是ver2.9的版本,也就是weekly的版本,比较老旧,而且担心哪天会不支持,决定替换成LTS版本,以绝后患。

其实升级方式有很多,因为不知道前人是如何安装的,采取最稳妥的替换war包的方式升级。

war的路径


 一般情况下,war的安装路径在/usr/share/jenkins目录下。

不过也有部分人不喜欢安装在这里,可以通过系统管理(System management)--> 系统信息(System Info)查找.war的文件,如下图:

war下载


先列出官网地址:https://jenkins.io/download/,可能会有GFW的原因导致被屏蔽。

我们可以使用如下几个链接去下载:

比如说我升级的是最新的LTS版本:2.46.3,路径:Index of /jenkins/war-stable-rc/2.46.3/

地址:https://mirrors.tuna.tsinghua.edu.cn/jenkins/war-stable-rc/2.46.3/jenkins.war

ubuntu系统可以使用wget下载

wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/war-stable-rc/2.46.3/jenkins.war

升级Jenkins


1. 停止Jenkins服务(记得备份原来的jenkins.war,以防万一)

http://jenkinsIP:port/exit

2. 替换最新的war包,并启动jenkins(一般也就java -jar jenkins.war即可)

 

参考:

https://stackoverflow.com/questions/11062335/update-jenkins-from-a-war-file的这句话:

You can overwrite the existing jenkins.war file with the new one and then restart Jenkins.
This file is usually located in /usr/share/jenkins.
If this is not the case for your system, in Manage Jenkins -> System Information, it will display the path to the .war file under executable-war.

 

END

posted @ 2017-06-08 14:33  疲惫的豆豆  阅读(31759)  评论(0编辑  收藏  举报