How to upgrade Jenkins to the latest version

From PheonixSolutions
Jump to navigation Jump to search

How to upgrade Jenkins to the latest version

[edit]

Introduction Jenkins is an open-source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery

Prerequisite

1. A user with sudo privileges
2. Jenkins console logins


Implementation

Step 1: Stop Jenkins service

  sudo service jenkins stop


Step 2: Take Jenkins instance backup as a recovery option

  cd /var/lib
  tar -cvzf jenkins_date.tar.gz jenkins/
  mv jenkins_date.tar.gz $HOME


Step 3: Take the backup of the current Jenkins version binary

  cd /usr/share/java
  mv jenkins.war jenkins.war.old


Step 4: Download the new LTS Jenkins version

  wget https://updates.jenkins-ci.org/latest/jenkins.war


Step 5: Start the Jenkins service

  service jenkins start


Step 6: If Jenkins start-up but with multiple exceptions errors on the Jenkins web page, we need to update plugins


Step 7: Stop Jenkins service

  sudo service jenkins stop


Step 8: Rename the config.xml file to config.xml.old which will disable authentication and other configurations

  cd /var/lib/jenkins
  mv config.xml config.xml.old


Step 9: Start the Jenkins service. It will create a new config.xml file

  service jenkins start


Step 10: Jenkins will start without the login page → Go to Manage Plugins and update all the plugins


Step 11: Stop Jenkins service

  sudo service jenkins stop


Step 12: Rename the current config.xml file that was created to config.xml.new


Step 13: Rename the initial customed config.xml.old file to config.xml


Step 14: Start the Jenkins service