In this article, we will install Jenkins on Ubuntu and examine the following items:

  • Developer commit to source code management system.
  • Jenkins job will be notified.
  • Jenkins send 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.

Now we need to update Ubuntu.

We need to install Jenkins now. Be aware it takes some time to install Jenkins.

The default port number for Jenkins is 8080. The below screenshot is the entry page or Dashboard of Jenkins.

2016-03-12_23-18-15

Restart Jenkins with this command: http://localhost:8080/restart

2016-03-12_23-44-52

We need git in our system so we will install it with below command.

Congratulations, Jenkins environment setup has been completed. 🙂

Integrate Jenkins and GitHub

In this tutorial, we will use GitHub as source code repository. We need to install 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

2016-03-12_23-39-04

2016-03-12_23-40-18

Above figure shows that, GitHub API Plugin have successfully installed to 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 Freestyle project. Click OK.

2016-03-16_22-43-04

  • Copy the URL from your GitHub project.

2016-03-16_22-48-06

  • In order to manage Jenkins, we need to set executable.

2016-03-16_23-42-14

  • Create a new job and name it.

2016-03-17_16-42-58

  • Specify your GitHub project at source code management.

2016-03-17_16-47-56

  • Add credentials  Username / Password

2016-03-17_16-57-49

  • You can change build trigger using below options.

2016-03-17_16-59-55

  • If your job is triggered you should below result. It will finish with SUCCESS! 🙂

2016-03-17_17-15-38