修改jenkins源为国内源

PS:jenkins安装方式为  yum install jenkins -y安装

# yun安装jenkins源

cat >>/etc/yum.repos.d/jenkins.repo <<-EOF
[jenkins]
name=Jenkins-stable
baseurl=http://pkg.jenkins.io/redhat-stable
gpgcheck=1

EOF

# 修改jenkins源为国内源
cd  /var/lib/jenkins/
find  -name "default.json" 
#/var/lib/jenkins/updates/default.json
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' /var/lib/jenkins/updates/default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' /var/lib/jenkins/updates/default.json systemctl restart jenkins

 

posted @ 2020-08-07 14:07  一个苦逼的运维人  阅读(1813)  评论(0编辑  收藏  举报