1、清華源TUNA(感謝TUNA) https://tuna.moe/
2、安裝Jenkins https://www.jenkins.io/ 也可以從TUNA下載 https://mirrors.tuna.tsinghua.edu.cn/jenkins/
3、安裝好打開(自己選擇安裝方式,我的是war)(感謝Jenkins)

4、修改 hudson.model.UpdateCenter.xml
原本為 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
修改為 http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
5、修改 default.json
http://www.google.com 替換成 http://www.baidu.com
http://updates.jenkins-ci.org/download 替換成 https://mirrors.tuna.tsinghua.edu.cn/jenkins
$ cd {你的Jenkins工作目錄}/updates #進入更新配置位置
第一種方法
$ vim default.json #這個Json文件與上邊的配置文件是相同的
:1,$s/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g
:1,$s/http:\/\/www.google.com/https:\/\/www.baidu.com/g
進入vim先輸入
:然后再粘貼上邊的:后邊的命令,注意不要寫兩個冒號!
修改完成保存退出:wq
方法二,使用sed
$ sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
這是直接修改的配置文件,如果前邊Jenkins用sudo啟動的話,那么這里的兩個
sed前均需要加上sudo
重啟Jenkins,安裝插件
特別感謝 (https://www.cnblogs.com/hellxz/p/jenkins_install_plugins_faster.html)
