Photo credit: https://www.flickr.com/photos/spacex/44451125454/
I've been trying to setup a Jenkins build of a private GitHub project recently and found it wasn't as straight forward as I thought. GitHub provides a feature called Deploy Keys, which are SSH keys used to authenticate servers to your GitHub repository. Here's how I set them up.
That's it! Now, using the Jenkins Git plugin, you can point your Jenkins Build Job at your GitHub repository and it should authenticate just fine.
This will only work for one repository. GitHub requires that your Deploy Keys be unique among your repositories. Ideally, you should be able to create multiple SSH keys on your Jenkins server, but I had trouble getting this to work. What I ended up doing instead was adding the SSH public key to my GitHub user account. This allows Jenkins build access to any of the private repositories I create.
I would ideally like to get the Jenkins GitHub plugin working, but after a 10 minute test, I stuck with my current setup so that I can move on to the next problem.
Share this: