In this article, we will install Jenkins on Ubuntu and examine the following items:
- Developer commits to source code management system.
- Jenkins job will be notified.
- Jenkins send a pull request to GitHub.
Configuration of Jenkins on Ubuntu
First, we have to add the key and source list to apt. Apply, below two commands in order.
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list
Now we need to update Ubuntu.
apt-get update
We need to install Jenkins now. Be aware it takes some time to install Jenkins.
apt-get install jenkins
The default port number for Jenkins is 8080. The below screenshot is the entry page or Dashboard of Jenkins.
Restart Jenkins with this command: http://localhost:8080/restart
We need git in our system so we will install it with the below command.
sudo apt-get install git
Congratulations, Jenkins’s environment setup has been completed. :)
Integrate Jenkins and GitHub
In this tutorial, we will use GitHub as a source code repository. We need to install the Jenkins GitHub plugin, for more information visit https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Plugin .
Manage Jenkins page, select Manage Plugins on the available tab search box = GitHub
The above figure shows that GitHub API Plugin has successfully installed to the system.
We will configure Jenkins to trigger a build when a file is modified in the GitHub repository.
- Connect to the Jenkins server again. Click the New Item link in the left navigation.
- Name your build job, and choose the Freestyle project. Click OK.
- Copy the URL from your GitHub project.
- In order to manage Jenkins, we need to set executable.
- Create a new job and name it.
- Specify your GitHub project at source code management.
- Add credentials Username / Password
- You can change the build trigger using the below options.
- If your job is triggered you should below result. It will finish with SUCCESS! :)
Thanks.
Onur Yazir

Onur YAZIR is a Senior Software Testing & DevOps Engineer 10+ years of experience. He has worked Huawei, Ericsson, Vodafone, Several FinTech companies, Gulf News, and Emirates Airlines. You can find detailed information about him on his linked-in page.
I think you’ll like it better in a multi-platform and multi-version git world if you define the git executable as “git” rather than as “/usr/bin/git”. The /usr/bin/git path does not work well on the default Windows git configurations, while “git” can work well in at least two different Windows configurations.
Helpful info. Fortunate me I found your web site accidentally, and I
am surprised why this twist of fate didn’t took place in advance!
I bookmarked it.