--- title: 'Jenkins & Gitlab Webhook settings' tags: jenkins,gitlab description: Jenkins & Gitlab Webhook settings --- # Jenkins & Gitlab Webhook settings --- [TOC] --- ## Jenkins & Gitlab 開通網路 ``` terminal sudo vim /etc/ssh/ssh_config ``` 將 StrictHostKeyChecking ask 改為 StrictHostKeyChecking no  打開Gitlab    --- ## Jenkins SSH key 產生 登入 jenkins ``` terminal sudo su jenkins Password: ```  ``` terminal ssh-keygen ``` SSH key產生 ``` terminal ssh-keygen ``` Public key ``` terminal cat /var/lib/jenkins/.ssh/id_rsa.pub ```  Privaty key ``` terminal cat /var/lib/jenkins/.ssh/id_rsa ```  --- ## Profile Access Tokens    記得複製 personal access token,因為離開此頁面就不會顯示  --- ## 設定Gitlab的SSH Keys  取得Jenkins的Public key  --- ## Jenkins gitlab download   打勾Gitlab,點擊 下載並於重新啟動後安裝  --- ## Jenkins 設定Gitlab & Git環境 管理Jenkins -> 設定系統  移到Gitlab標題     移到Git plugin  用Putty進入Jenkins ubuntu linux,安裝git ``` terminal sudo apt install git ``` 查看git路徑 ``` terminal which git ```  回到Jenkins網頁,管理Jenkins -> 全域工具設定  移到Git installations  --- ## Jenkins 新增專案   回首頁  --- ## Gitlab 新增專案   在把測試專案push上去 --- ## Jenkins & Gitlab webhook 設定 點擊Jenkins專案   移到 原始碼管理    請把Private key 輸入進去   移到 建置觸發程序,請把GitLab webhook URL: http://192.168.10.167:8080/project/demo ,記起來   請把Secret token產生,記起來  點擊Gitlab專案     測試Gitlab是否有跟Jenkins有通      --- ## 參考鏈結 https://dotblogs.com.tw/Echo/2018/04/29/Jenkins_Plugin_GitLab_Webhook https://www.ltsplus.com/linux/fix-ssh-login-host-key-verification-failed https://blog.csdn.net/u013189824/article/details/109495685 https://www.cnblogs.com/xiao987334176/p/11425560.html https://tw511.com/a/01/37663.html https://www.youtube.com/watch?v=-O4tiLzYJMI ---
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up