Jenkins安装插件的三种方法
1. 更改Jenkins镜像站为国内镜像站
代码语言:javascript
复制[root@jenkins ~]#
sed -i.bak 's#updates.jenkins.io/download#mirror.tuna.tsinghua.edu.cn/jenkins#g' /var/lib/jenkins/updates/default.json
[root@jenkins ~]#sed -i 's#www.google.com#www.baidu.com#g' /var/lib/jenkins/updates/default.json
#注意:如果是tomcat运行war包方式需要下面路径
[root@jenkins ~]#sed -i.bak 's#https://updates.jenkins.io/download#https://mirror.tuna.tsinghua.edu.cn/jenki ns#g' /root/.jenkins/updates/default.json
升级站点URL替换成国内镜像地址
#国内镜像源
https://mirror.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
2. Jenkins官网下载插件导入到Jenkins中
代码语言:javascript
复制https://plugins.jenkins.io
国内站点插件下载地址:
https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/
3. 将离线包复制到到安装目录
代码语言:javascript
复制[root@jenkins ~]#systemctl stop jenkins
[root@jenkins ~]#tar jenkins_plugins.tar.gz -C /var/lib/jenkins/plugins/
[root@jenkins ~]#chown -R jenkins.jenkins /var/lib/jenkins/plugins/
[root@jenkins ~]#systemctl start jenkins