After Jenkins is deployed, if you don’t install the plug-in, it will be a bare commander and can’t do anything!
So first log in to the administrator account, then click System Management and then click Plug-in Management on the right to install the necessary CI/CD plug-ins.
But here comes the problem. Jenkins downloads plug-ins very slowly, and often prompts that the plug-in download fails. It’s really heartbreaking!
The purpose of this article is to truly speed up the installation of plugins in Jenkins and reduce the failure rate! Hurry up and learn!
Failure method
When it comes to accelerating the speed of Jenkins installation plug-in, most tutorials use it in the plug-in configuration.
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json replaces the original official json.
Here we find that whether the source is changed or not, the speed of downloading plug-ins has not changed!
Let’s take a look at what Tsinghua Source pulled down. Here we use the official download plug-in URL global search.
I was surprised to find that the download path of each plug-in has not changed. What has changed is that the json is downloaded from Tsinghua University, and the hard-coded plug-in download address has not changed. It is still downloaded from the official website!
Only the outside has changed, but the inside is still the same stuffing! You said "Are you angry?" Then you suddenly realized the reason why solving the case was "ineffective".
Useful ways
1. Modify the hudson.model.UpdateCenter.xml value in the .jenkins directory to:
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
2. Modify the default.json file in the updates folder
-
Replace all http://updates.jenkins-ci.org/download in the file with https://mirrors.tuna.tsinghua.edu.cn/jenkins
-
http://www.google.com is modified to
http://www.baidu.com
3. In the browser, go to http:localhost:8080/reload to reload the configuration.
Or use http:localhost:8080/restart, restart Jenkins, choose to install the recommended plug-in, and the installation is successful in seconds, which is super fast! !
2 ways to install plugins
The first way: plug-in management-search for the plug-ins you need, and then install them
Second method: Download a .hpi file
Finish
Since discovering this method, friends no longer have to worry about slow download speeds or installation failures of the Jenkins plug-in.