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)