jenkins插件下载慢 初始化慢
jenkins插件下载慢 初始化慢
第一种方法(最简便方法):
在需要安装的服务器上安装nginx代理原地址
nginx配置文件详情访问nginx.conf
echo '127.0.0.1 mirrors.jenkins-ci.org' >> /etc/hosts
docker run -itd -p 81:80 -p 443:443 --name=nginx --restart=always -v /etc/localtime:/etc/localtime registry.cn-beijing.aliyuncs.com/myki/jenkins_proxy:latest
第二种方法:
创建jenkins插件中心的ca证书
mkdir $JENKINS_HOME/update-center-rootCAs
cat > $JENKINS_HOME/update-center-rootCAs/jenkins-update-center-cn-root-ca.crt <<END
-----BEGIN CERTIFICATE-----
MIICcTCCAdoCCQD/jZ7AgrzJKTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJD
TjELMAkGA1UECAwCR0QxCzAJBgNVBAcMAlNaMQ4wDAYDVQQKDAV2aWhvbzEMMAoG
A1UECwwDZGV2MREwDwYDVQQDDAhkZW1vLmNvbTEjMCEGCSqGSIb3DQEJARYUYWRt
aW5AamVua2lucy16aC5jb20wHhcNMTkxMTA5MTA0MDA5WhcNMjIxMTA4MTA0MDA5
WjB9MQswCQYDVQQGEwJDTjELMAkGA1UECAwCR0QxCzAJBgNVBAcMAlNaMQ4wDAYD
VQQKDAV2aWhvbzEMMAoGA1UECwwDZGV2MREwDwYDVQQDDAhkZW1vLmNvbTEjMCEG
CSqGSIb3DQEJARYUYWRtaW5AamVua2lucy16aC5jb20wgZ8wDQYJKoZIhvcNAQEB
BQADgY0AMIGJAoGBAN+6jN8rCIjVkQ0Q7ZbJLk4IdcHor2WdskOQMhlbR0gOyb4g
RX+CorjDRjDm6mj2OohqlrtRxLGYxBnXFeQGU7wWjQHyfKDghtP51G/672lXFtzB
KXukHByHjtzrDxAutKTdolyBCuIDDGJmRk+LavIBY3/Lxh6f0ZQSeCSJYiyxAgMB
AAEwDQYJKoZIhvcNAQELBQADgYEAD92l26PoJcbl9GojK2L3pyOQjeeDm/vV9e3R
EgwGmoIQzlubM0mjxpCz1J73nesoAcuplTEps/46L7yoMjptCA3TU9FZAHNQ8dbz
a0vm4CF9841/FIk8tsLtwCT6ivkAi0lXGwhX0FK7FaAyU0nNeo/EPvDwzTim4XDK
9j1WGpE=
-----END CERTIFICATE-----
END
修改update center地址为华为云地址,也可以改为清华大学或其他源地址
cd {Jenkins工作目录}/updates
cp default.json{,.bak}
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
收集国内常用jenkins插件源地址:
官方插件中心地址: http://updates.jenkins-ci.org/update-center.json
清华大学镜像: https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
Jenkins 中文社区: https://updates.jenkins-zh.cn/update-center.json
华为开源镜像站: https://mirrors.huaweicloud.com/jenkins/updates/update-center.json
文章作者 🐳Myki
上次更新 2020-08-25