3.15. Upgrading Your Jenkins Installation

Upgrading Jenkins is easy—you simply replace your local copy of the jenkins.war file and restart Jenkins. However you should make sure there are no builds running when you restart your server. Since your build environment configuration details, plugins, and build history are stored in the Jenkins home directory, upgrading your Jenkins executable will have no impact on your installation. You can always check what version of Jenkins you are currently running by referring to the version number in the bottom right corner of every screen.

If you have installed Jenkins using one of the Linux packages, Jenkins can be upgraded using the same process as the other system packages on the server.

If you are running Jenkins as a stand-alone instance, you can also upgrade your Jenkins installation directly from the web interface, in the Manage Jenkins section. Jenkins will indicate if a more recent version is available, and give you the option to either download it manually or upgrade automatically (see Figure 3.10, “Upgrading Jenkins from the web interface” ).

Upgrading Jenkins from the web interface

Figure 3.10. Upgrading Jenkins from the web interface

Once Jenkins has downloaded the upgrade, you can also tell it to restart when no jobs are running. This is probably the most convenient way to upgrade Jenkins, although it will not work in all environments. In particular, you need to be running Jenkins as a stand-alone application, and the user running Jenkins needs to have read-write access to the jenkins.war file.

If you are running Jenkins on an application server such as Tomcat or JBoss, you might need to do a bit more tidying up when you upgrade your Jenkins instance. Tomcat, for example, places compiled JSP pages in the CATALINA_BASE/work directory. When you upgrade your Jenkins version, these files need to be removed to prevent the possibility of any stale pages being served.

Any plugins you have installed will be unaffected by your Jenkins upgrades. However, plugins can also be upgraded, independently of the main Jenkins executable. You upgrade your plugins directly in the Jenkins web application, using the Jenkins Plugin Manager. We discuss plugins in more detail further on in this book.