Update Jenkins from a war file

2020-02-16 08:32发布

I have a machine with Ubuntu 12.04 and have installed Jenkins ver. 1.424.6 using apt-get based on this guide, but there is a new version:

New version of Jenkins (1.447.2) is available for download (changelog).

If I press download, I get a jenkins.war file... but how do I use that for upgrading my current installation? or is that not possible before the apt repositories gets updated?

12条回答
兄弟一词,经得起流年.
2楼-- · 2020-02-16 08:54
apt-get update
apt-get upgrade 

by far the easiest way to upgrade on linux, works like a charm everytime.

查看更多
SAY GOODBYE
3楼-- · 2020-02-16 08:54

I didn't want to install the x11-common and other components that come bundled in the apt-get install approach, so I just downloaded the .war file and ran the command Francois mentioned. That worked nicely, but you have to write your own daemon script with that approach. Full details here: http://strem.in/stream/9488/Using-the-war-file-for-jenkins-ci

查看更多
Fickle 薄情
4楼-- · 2020-02-16 08:54

To Upgrade Jenkins WAR file, follow the steps below:

  • Stop Jenkins server using command: systemctl stop jenkins
  • Go to Jenkins war location: ex: /usr/lib/jenkins
  • Take a backup from jenkins.war: mv jenkins.war jenkins.war_bkp
  • Download Jenkins using wget or curl command: wget http://updates.jenkinsci.org/download/war/(version)/jenkins.war
  • Starting Jenkins server using command: systemctl start jenkins
  • Check Jenkins server status using command: systemctl status jenkin
查看更多
乱世女痞
5楼-- · 2020-02-16 08:54
#on ubuntu, in /usr/share/jenkins:

sudo service jenkins stop
sudo mv jenkins.war jenkins.war.old
sudo wget https://updates.jenkins-ci.org/latest/jenkins.war
sudo service jenkins start
查看更多
地球回转人心会变
6楼-- · 2020-02-16 08:55

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.

查看更多
手持菜刀,她持情操
7楼-- · 2020-02-16 08:57

Though I wouldn't consider this as a valid answer to OP's question, I'd still emphasize that the best way to deploy Jenkins (and likely most if not all libraries/packages/software) on Ubuntu is to leverage aptitude (or apt-get) management system.

It is documented here: https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu (notice that if you want to use the LTS build, hit on this repo http://pkg.jenkins-ci.org/debian-stable/)

So if by any chance you actually did use this approach, you'd simply do a apt-get upgrade jenkins

查看更多
登录 后发表回答