jenkins gitlab整合注意事項


   jenkins整合gitlab時,Source Code Management添加gitlab倉庫路徑無論怎么嘗試都報如下兩個異常:

Failed to connect to repository : Command "git ls-remote -h git@xxxxx.com:xxx/dev_test.git HEAD" returned status code 128:
stdout: 
stderr: Permission denied, please tryagain. 
Permission denied, please try again. 
Permission denied(publickey,gssapi-keyex,gssapi-with-mic,password). 
fatal: The remote end hung up unexpectedly

   或

Failed to connect to repository : Command "/usr/local/git/bin/git -c core.askpass=true ls-remote -h http://www.xxx.com/gitlab/root/test.git HEAD" returned status code 128:
stdout: 
stderr: fatal: Unable to find remote helper for 'http'

  原因是:由於運行jenkins用戶沒有生成ssh私鑰,且沒有添加gitlab中。因此導致了如上異常。

  生成ssh私鑰

ssh-keygen -t rsa -C "admin@example.com"

  運行上述命令,並一路回車即可生成相應的私鑰。

  將私鑰添加到gitlab

cat ~/.ssh/id_rsa.pub

  將所有內容添加到gitlab-->Profile Settings-->SSH Keys-->Add an SSH key。

  保存后重啟jenkins即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM