日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

gitlab+jenkins 搭建

發布時間:2024/7/5 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 gitlab+jenkins 搭建 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

繼前一篇gitlab,這一篇介紹jenkins搭建并與gitlab進行集成---這里不是詳細的步驟

環境
系統:centos 7.3

jenkins版本:jenkins-2.176.1-1.1.noarch

# vim /etc/selinux/config SELINUX=disabled # setenforce 0 # getenforce

官方安裝文檔

https://pkg.jenkins.io/redhat-stable/

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key yum install jenkins # systemctl start jenkins http://**:8080/

第一次打開界面后,會根據提示 添加

# cat /var/lib/jenkins/secrets/initialAdminPassword

選擇安裝插件--推薦安裝,全部成功

--這里如果遇到offline,詳細參考文章末尾處理

實例配置
Jenkins URL: http://*:8080/

創建用戶,實例配置后,進行使用jenkins

--插件管理

--憑據管理

?

?--創建任務

--github配置(如果這里添加添加報錯,詳細見文章末尾)

--構建觸發器

?--gitlab --user settings --access tokens

創建Personal Access Tokens=**************** # curl -X PUT --header "PRIVATE-TOKEN: *************" 'http://*****/api/v4/application/settings?allow_local_requests_from_hooks_and_services=true'

創建gitlab hook

--RUL是在jenkins對應任務中的rul,token是上面generate生成的token

在sourcetree客戶端等執行git的一系列操作

然后push

在jenkins

?

目前就測試到這里

?--錯誤處理

1?

--運行:立即構建,控制臺輸出 --1> git fetch --tags --progress git@*:dba/mysql_test.git +refs/heads/*:refs/remotes/origin/* ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git fetch --tags --progress git@*:dba/mysql_test.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). fatal: Could not read from remote repository.

解決

解決: --1 在gitlab添加ssh key user settings--ssh keys/ [root@jenkins ~]# cat .ssh/id_rsa.pub ##添加該密鑰 --2 在jenkins的工程 源碼管理-git-URL= git@**:root/hq_test.git credentials=root, [root@jenkins ~]# cat .ssh/id_rsa ##添加該密鑰

?

2 offine處理

分別使用看誰能下載

wget https://updates.jenkins.io/update-center.json wget http://updates.jenkins.io/update-center.json

看哪一個能ping通,就修改為哪一個,再重啟jenkins

# systemctl stop jenkins # systemctl start jenkins [root@localhost opt]# find / -name "hudson.model.UpdateCenter.xml" /home/data/jenkins/hudson.model.UpdateCenter.xml [root@localhost opt]# vim /home/data/jenkins/hudson.model.UpdateCenter.xml <?xml version='1.1' encoding='UTF-8'?> <sites><site><id>default</id><url>http://updates.jenkins.io/update-center.json</url></site> </sites>

轉載于:https://www.cnblogs.com/yhq1314/p/11158701.html

總結

以上是生活随笔為你收集整理的gitlab+jenkins 搭建的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。