Jenkins Gitlab Integration considerations

Source: Internet
Author: User

When Jenkins integrates Gitlab, the Source Code management adds Gitlab warehouse path regardless of how it tries to report the following two exceptions:

" git ls-remote-h [email protected]:xxx/dev_test.git HEAD "  - : 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

Or

" /usr/local/git/bin/git-c core.askpass=true ls-remote-h http://www.xxx.com/gitlab/root/test.git HEAD "  -  Findfor'http'

The reason: Because the user running Jenkins does not generate an SSH private key and is not added in Gitlab. Therefore, the above exception is caused.

Generate SSH private key

Ssh-keygen " [email protected] "

Run the above command and enter it all the way to generate the corresponding private key.

To add a private key to Gitlab

Cat ~/. ssh/id_rsa.pub

Add all content to Gitlab-->profile settings-->ssh keys-->add an SSH key.

Restart Jenkins after saving.

Jenkins Gitlab Integration considerations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.