How to upgrade Jenkins to latest version
In this short article, we will learn how to upgrade Jenkins to latest version. Log in to your Linux machine and let's get started.
Stop Jenkins service
First, we need to stop the Jenkins service. Run the following command to stop the Jenkins service.
bash1
sudo systemctl stop jenkins
bash
1 | sudo systemctl stop jenkins |
Change work directory
Change working directory to the Jenkins war file location. Run the following command to change the working directory.
bash1
cd /usr/share/java
bash
1 | cd /usr/share/java |
Some times, the Jenkins war file location will be different. You can find the Jenkins war file location from Jenkins System Information page by using the URL: https:/your-dns-name:8080/systemInfo.
Backup Jenkins war file
Before upgrading Jenkins, it is a good practice to backup the Jenkins war file. Run the following command to backup the Jenkins war file.
bash1
sudo mv jenkins.war jenkins.war_old
bash
1 | sudo mv jenkins.war jenkins.war_old |
Download Jenkins war file
Now, we need to download the latest Jenkins war file. Run the following command to download the latest Jenkins war file.
bash1
sudo wget https://updates.jenkins.io/download/war/latest/jenkins.war
bash
1 | sudo wget https://updates.jenkins.io/download/war/latest/jenkins.war |
Start Jenkins service
Now, we need to start the Jenkins service. Run the following command to start the Jenkins service.
bash1
sudo systemctl start jenkins
bash
1 | sudo systemctl start jenkins |
Conclusion
In this article, we learned how to upgrade Jenkins to latest version. I hope you enjoyed this article. If you have any issue regarding this tutorial, mention your issue in the comment section or reach me through my E-mail.
Happy Coding
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Comments
GitalkDisqus