In this post we are going to assume you are setting up Jenkins on Ubuntu Linux 10.10.
Installing Jenkins
Jenkins-CI can be installed on Ubuntu Linux through aptitude. I have outlined the key steps below. In your terminal type in the following commands:
- wget -q -O -http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key| sudo apt-key add -
- sudo echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
- sudo aptitude update
- sudo aptitude install jenkins
This will install Jenkins onto your computer directly. The default url which you can access Jenkins is http://localhost:8080/ (so make sure you’re not running any other services in port 8080, e.g. Tomcat).
Navigate to http://localhost:8080/ and you will be greeted with the Jenkins dashboard.
(Please note that you may not have a “Job” like in the screen shot above. To setup a job, click “New Job” in the top left corner of the dashboard)
Adding git Support in Jenkins
To add git support, navigate from the dashboard:
- Manage Jenkins –> Plugin Manager –> Available
Find:
- Jenkins GIT plugin”
- Github plugin
Check both check boxes. Scroll to the bottom of the page and click “Install”.
If you have installed the Jenkins GIT plugin properly, you will see it in the “Installed” tab of the plugin manager.
Creating a New Job which clones from Git:
In the next screen under “Source Code Management” section, select “Git” and add the url to the repository and the branch which you would like to checkout.
Potential Issues:
Currently the Jenkin’s plugin does not support cloning private repositories using private key files with pass phrase. The solution which I am currently employing is to generate a private key file without a pass phrase.
This concludes the guide to setting up Jenkins to use with github (or rather even just general git repositories).




Pingback: Emma and Jenkins | Derek Kwok's Blog
April 26, 2011 at 10:13 am
do you have any idea how to set jenkins up so that it ONLY builds when the branch in “Branch Specifier” is changed? Github fires the post-receive service hook when any branch is pushed to, but we want to set up a jenkins job that only builds when the specified branch gets a new commit.
September 6, 2011 at 12:35 am
This has probably been answered, but in case anyone is looking, you can use the “Poll SCM” build trigger in Jenkins, in combination with a “branch specifier” in the “Source Code Management” section of job configuration (assuming you have the git plugin installed) – and that will only build when the polling detects that the specified branch has been updated.
September 9, 2011 at 8:51 pm
Instead of polling Github periodically, I think Michael Johnston wants to have Github fire a build request when there’s a new commit pushed to it. This means that Jenkins should receive the request to build instead of asking Github.
Fortunately, it looks like the new Jenkins Github Plugin has a new feature: “Trigger a build when a change is pushed to GitHub”.
The link to Github plugin for Jenkins: https://wiki.jenkins-ci.org/display/JENKINS/Github+Plugin
May 4, 2012 at 4:40 am
Do you know if this plugin will operate the same, or at least provide the same functionality, with Github Enterprise?