Jenkins安裝過程中出現一個錯誤: No such plugin: cloudbees-folder
Jenkins外掛安裝注意
Jenkins裡面有眾多外掛來支援持續整合、持續部署
預設Jenkins外掛是到海外下載,所以非常慢,經常安裝失敗
如果是ssl證書不存在或者有問題,或者網路有問題,就會出現在這個問題(我暫時遇到的都是)。
1、通過以下網址找到最快的映象源
http://mirrors.jenkins-ci.org/status.html
2、然後將映象源更換為國內的,
參考下面兩篇文章進行更換,這樣最徹底有效
windows下的
3、還有一種案例是因為無法檢視https網址造成的,就講https改成http就好了。報錯為
There were errors checking the update sites: SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: > sun.security.provider.certpath.SunCertPathBuilderException: unable to > find valid certification path to requested target
更優的解法:
以上的方法更換映象後,安裝外掛的速度還是不能真正提升上來的話,可以使用nginx和hosts檔案將下載請求進行跳轉,具體操作如下:
關鍵一點:如果還存在上述第三的報錯時,需要將~/.jenkins/hudson.model.UpdateCenter.xml中的https改為http,如下:
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>http://updates.jenkins.io/update-center.json</url>
</site>
</sites>
Jenkins外掛國內源介紹
國外:https://updates.jenkins-ci.org/download/plugins/
國內:https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/
使用Nginx可以把請求轉到國內源
yum install nginx -y
編輯nginx的systemctl,/usr/lib/systemd/system/nginx.service
保留start reload,刪除掉一部分
外掛地址轉發到清華源
location /download/plugins
{
proxy_set_header Host mirrors.tuna.tsinghua.edu.cn;
rewrite ^/download/plugins/$ /jenkins/plugin/$1 break;
proxy_pass https://mirros.tuna.tsighua.edu.cn;
}
啟動nginx
systemctl enable nginx
systemctl restart nginx
/etc/hosts增加
127.0.0.1 updates.jenkins-ci.org
當Jenkins訪問updates.jenkins-ci.org,就會被Nginx轉到國內,使用國內網安裝外掛