使用镜像安装jenkins
设置jenkins插件下载镜像也可以参考。
网上好几个文章都是要不停的改 default.json文件。治标不治本。
download and install Jenkins
下载地址: https://jenkins.io/zh/download/
安装过程:略
安装好以后先不要启动,如果已经启动了先停止
jenkins stop
修改 UpdateCenter 地址为 清华的境像地址
进入 Jenkins 目录 找到 hudson.model.UpdateCenter.xml 文件。
修改 url为 https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
设置 nginx 或者 caddy 代理
- nginx
1 | rewrite ^/download/plugins/(.*)$ https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/$1? last; |
or
1 | location /download/plugins |
- caddy
1 | :80 { |
设置 hosts
找到hosts文件 添加一行
192.168.1.10 updates.jenkins-ci.org
如果 代理设置在本地 就填 127.0.0.1
启动 Jenkins
jenkins start
打开 localhost:8080
这样就可以有一个愉快的安装过程了。
更新
可以直接使用 jenkins中文社区提供的 UpdateCenter地址,就可以不需要配置代理了
https://updates.jenkins-zh.cn/update-center.json
不过不知道什么原因,我更换成这个地址时尝试失败了。
如果换成这个地址有问题 就停止 jenkins,地址换回去 再重新启动
2020/06/02 更新
hudson.model.UpdateCenter.xml 文件在 mac下的 /Users/xxx/.jenkins 目录
caddy 配置. 可以更新 war版本了.
1 |
|
感谢您的阅读,本文由 smallwhite's Blog 版权所有。如若转载,请注明出处:smallwhite's Blog(https://smallwhite.ml/pub/jenkins/install-jenkins-use-mirrors.html)