Let's remove jenkins from the picture to verify gitlab is setup correctly. 
I want to verify that if you were to use jenkins' key, you can clone the 
repo.

Steps:


   1. remove jenkins' deploy key from gitlab(save it)
   2. on your local machine, setup your ssh config file to have the git 
   user use jenkins' key. this is a good link 
   
<http://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/> 
for 
   config setup. (or better yet move your public and private key somewhere 
   else and replace it with jenkins')
   3. verify that you cannot clone the repo using jenkins' key (#1 removed 
   this access)
   4. add back jenkins' deploy key to gitlab
   5. verify that you can clone the repo.

There are several ways to have jenkins setup to clone repo using ssh. I'll 
describe what I do:

My jenkins instance runs on a different machine under the "tomcat7" 
user(this may be different for you). tomcat7's home directory on my box is 
/user/share/tomcat7
place jenkins' public and private keys in: /usr/share/tomat7/.ssh/
permissions do matter. use 600 for the private key and 644 for public key.

In the jenkins UI for a job..

When setting up the git section, copy-and-paste the ssh url from gitlab and 
explicitly set the credentials to *none*.

It's worth noting that our jenkins is a gitlab user(not using deploy keys), 
since our jenkins does pushes too.

Hopefully I didn't leave out any steps and this works for you!


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to