jenkins安装插件使用清华源

一:安装JDK

清华源官方网站: https://mirrors.tuna.tsinghua.edu.cn

[root@keepalived-127 ~]# yum install java-1.8.0-openjdk -y
Jenkins 安装过程中会要求安装推荐插件或自定义插件,默认是从Jenkins 官网拉取插件,国内网络访问Jenkins 官网比较慢,导致安装时间长。

[root@keepalived-127 ~]# java -version

二:安装nginx代理,指向清华源

      Jenkins 安装时会默认从updates.jenkins-ci.org 拉取,我们可以采用nginx代理的方式将其代理至mirrors.tuna.tsinghua.edu.cn ,方法如下:

1:安装nginx,并且配置host 解析:

[root@keepalived-127 ~]# vi /etc/hosts
127.0.0.1 updates.jenkins-ci.org


2:指向清华源

[root@keepalived-127 conf.d]# cat jenkins.conf 

    server {
        listen       80;
        server_name updates.jenkins-ci.org;
        location /download/plugins {
                proxy_next_upstream http_502 http_504 error timeout invalid_header;
                proxy_set_header Host mirrors.tuna.tsinghua.edu.cn;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
                rewrite /download/plugins/(.*) /jenkins/plugins/$1 break;
                proxy_pass https://mirrors.tuna.tsinghua.edu.cn;
       }

 }

三:重启nginx

[root@keepalived-127 conf.d]# nginx -s reload

四:安装jenkins,会快很多

[root@keepalived-127 ~]# wget https://pkg.jenkins.io/redhat/jenkins-2.156-1.1.noarch.rpm

[root@keepalived-127 ~]# rpm -ivh jenkins-2.156-1.1.noarch.rpm

[root@keepalived-127 src]# systemctl start jenkins
[root@keepalived-127 src]# systemctl status jenkins

五:浏览器打开

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值