使用国内镜像加速你的jenkins

老铁们,是不是每次安装 jenkins 的时候,下载插件都能等上半天一天的。还在为此烦恼么,看过此篇文章立即解决你的烦恼。

国内已经有几家站点都同步了 jenkins 仓库和插件仓库,当你设置了清华大学的 update-center.json 时,在满怀欣喜的等待飙升的下载速度,得到的确实一动不动的进度条,那是因为国内镜像源是原封不动的同步 jenkins仓库的,其 update-center.json 里的插件下载地址还是 jenkins 的地址,当然加速不了。需要把这个文件里的下载路径更改为国内镜像源地址,才能享受飙升的下载速度。

为此,我针对国内的镜像站点一一生成了 update-center.json 下面就教大家怎么使用吧!

测试速度

在使用国内镜像站点的时候,不妨先测试下哪个站点下载速度最快的,我们当然要选择最靓的那个崽了。

镜像站点

  • tencent https://mirrors.cloud.tencent.com/jenkins/
  • huawei https://mirrors.huaweicloud.com/jenkins/
  • tsinghua https://mirrors.tuna.tsinghua.edu.cn/jenkins/
  • ustc https://mirrors.ustc.edu.cn/jenkins/
  • bit http://mirror.bit.edu.cn/jenkins/
# curl -sSL https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/speed-test.sh | bash

Jenkins mirror update center speed test

[Mirror Site]
tencent       :  https://mirrors.cloud.tencent.com/jenkins/
bit           :  http://mirror.bit.edu.cn/jenkins/
huawei        :  https://mirrors.huaweicloud.com/jenkins/
tsinghua      :  https://mirrors.tuna.tsinghua.edu.cn/jenkins/
ustc          :  https://mirrors.ustc.edu.cn/jenkins/

[Test]
Test File        : updates/current/plugin-versions.json

Site Name     IPv4 address        File Size     Download Time       Download Speed
tencent       111.231.36.190      9.2M          2.6s                3.58MB/s
bit           202.204.80.77       9.2M          6.6s                1.39MB/s
huawei        117.78.24.32        9.2M          0.5s                19.4MB/s
tsinghua      101.6.8.193         9.2M          9.6s                976KB/s
ustc          202.38.95.110       9.2M          1.2s                7.75MB/s      

COPY

huawei 就是那个最靓的崽

使用国内镜像

当我们在安装完 jenkins 的时候,别着急登录web,先使用下国内源

  1. 先上传自定义的ca证书

    因为 update-center.json 需要证书签名,jenkins会去校验里面的数据。

[ ! -d /var/lib/jenkins/update-center-rootCAs ] && mkdir /var/lib/jenkins/update-center-rootCAs
wget https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/rootCA/update-center.crt -O /var/lib/jenkins/update-center-rootCAs/update-center.crt
chown jenkins.jenkins -R /var/lib/jenkins/update-center-rootCAs
COPY
  1. 更改url

这里在终端里进行更改

sed -i ‘s#https://updates.jenkins.io/update-center.json#https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/updates/huawei/update-center.json#‘ /var/lib/jenkins/hudson.model.UpdateCenter.xml
COPY

当然也可以通过web 来更改:Go to Jenkins → Manage Jenkins → Manage Plugins → Advanced → Update Site and submit URL to your https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/updates/huawei/update-center.json

然后再去 web 页面初始化你的 jenkins,享受速度飙升的快感吧。

其他镜像站点的 update-center.json

文件会在每天utc时间1点钟更新

Site Source CDN
tencent https://raw.githubusercontent.com/lework/jenkins-update-center/master/updates/tencent/update-center.json https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/updates/tencent/update-center.json
huawei https://raw.githubusercontent.com/lework/jenkins-update-center/master/updates/huawei/update-center.json https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/updates/huawei/update-center.json
tsinghua https://raw.githubusercontent.com/lework/jenkins-update-center/master/updates/tsinghua/update-center.json https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/updates/tsinghua/update-center.json
ustc https://raw.githubusercontent.com/lework/jenkins-update-center/master/updates/ustc/update-center.json https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/updates/ustc/update-center.json
bit https://raw.githubusercontent.com/lework/jenkins-update-center/master/updates/bit/update-center.json https://cdn.jsdelivr.net/gh/lework/jenkins-update-center/updates/bit/update-center.json

原文地址 https://lework.github.io/2020/03/05/jenkins-update-center/

原文地址:https://www.cnblogs.com/cfsxgogogo/p/12613211.html

时间: 2024-08-29 11:33:32

使用国内镜像加速你的jenkins的相关文章

安装使用yarn,使用国内镜像加速npm和yarn

安装yarn https://yarnpkg.com/lang/zh-hans/docs/install/ 使用国内镜像加速npm和yarn 1. npm config set registry=https://registry.npm.taobao.org 2. yarn config set registry https://registry.npm.taobao.org 3. 下载cnpm:npm install -g cnpm --registry=https://registry.np

在Ubuntu18.04安装gitlab国内镜像加速 [转]

在Ubuntu18.04安装gitlab国内镜像加速 代码 发表于 11个月前 (05-08) 3条评论 现在部署私有的gitlab已经非常的方便,唯一的问题在国内下载速度太慢了.幸好清华大学有镜像. 本文步骤参考官方文档,当前的gitlab版本10.7.3 Ubuntu版本18.04LTS .  官方文档里的ee改成ce.收费版和免费版的区别. 步骤如下: 安装配置依赖项 sudo apt-get update sudo apt-get install -y curl openssh-serv

Docker CE安装及配置国内镜像加速教程

Docker CE安装教程 一.版本说明 2017年2月份,Docker公司发布了全新的Docker版本:V1.13.0.从2017年3月1号开始,Docker的版本命名发生如下变化: 项目 说明 版本格式 YY.MM stable版本 每个季度发行 edge版本 每个月发行 同时将Docker分成CE和EE 2个版本.CE版本即社区版(免费,支持周期三个月),EE即企业版,强调安全,付费使用. Docker 会每月发布一个 edge 版本(17.03, 17.04, 17.05...),每三个

在Docker Hub上你可以很轻松下载到大量已经容器化的应用镜像,即拉即用——daocloud国内镜像加速

Docker之所以这么吸引人,除了它的新颖的技术外,围绕官方Registry(Docker Hub)的生态圈也是相当吸引人眼球的地方. 在Docker Hub上你可以很轻松下载到大量已经容器化的应用镜像,即拉即用.这些镜像中,有些是Docker官方维护的,更多的是众多开发者自发上传分享的.而且你还可以在Docker Hub中绑定你的代码托管系统(目前支持Github和Bitbucket)配置自动生成镜像功能,这样Docker Hub会在你代码更新时自动生成对应的Docker镜像,是不是很方便?

Composer 设置国内镜像加速命令

1.在创建项目之前,我们先在虚拟机中运行以下命令来实现 Composer 安装加速 : $ composer config -g repo.packagist composer https://packagist.phpcomposer.com1或者https://laravel-china.org/composer $ composer config -g repo.packagist composer https://packagist.laravel-china.org12.查看Compo

docker设置引用国内镜像加速

设置步骤: 1 先到daocloud.io网站注册一个账号 过程略,注册成功后,进入控制台 2 点击控制台上的加速器 拉到中间部分,有一个『主机监控程序』的文字链接,见下图: 然后选择主机类型,我用的是mac,所以选择mac主机: 如果已经安装好了docker toolbox最新版,直接点击[安装好了] 然后会出现二条命令,复制粘贴执行即可: 注:如果按它的提示,最后出现latest: Pulling from daocloud/daomonit not found之类的错误,可以尝试 1 do

docker国内镜像加速

? 在/etc/docker/daemon.json中添加内容: { "registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com"] } 重启docker systemctl restart docker 原文地址:https://www.cnblogs.com/young233/p/11013520.html

Docker配置国内加速器加速镜像下载

针对Docker客户端版本大于1.10.0的用户 修改daemon配置文件/etc/docker/daemon.json来使用加速器,这个是阿里给出的代码 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["<your accelerate address>"] } EOF sudo systemctl daem

Docker镜像加速

原文发表于cu:2016-05-31 本文属于重发,当前Daocloud设置镜像的方式就是一条命令:curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://xxxxxxxx.m.daocloud.io 墙内访问Docker Hub的速度太慢,daocloud mirror在国内做得是很不错的. 一.前置条件 1. 环境 Server:CentOS-7-x86_64-1511 Docker:1.11.1 2.