How to Install and configure Jenkins on CentOS 6.4 – Part III

In my previous articles (Jenkins Part I and Jenkins Part II) I have already described how to install Jenkins, how to Setup User account on Jenkins, how to Configure Nodes on Jenkins. In this article we will see how to configure a job on Jenkins. Basically the job will deploy an application from Github on a configured node. We will configure a simple Job in this part. We will just clone a github repository in a node using Jenkins. But in our later articles we will discuss about critical deployments.

We will complete this in three steps.

  • Install required Plugin
  • Configure Job
  • Build the Job and verify

Step 1 (Install required Plugin)

If we are using GIT as our Sour Code Management then we have to install plugin for it. The git plugin will help use to deploy the codes on a node. It’s very simple to configure. To install a plugin follow the steps as described below

Click on Manage Jenkins > Click on Manage Plugins > Click on Available Tab > Filter the Git Plugins > Chose the Git Plugin > Click on install without restart. > Chose Restart Jenkins when installation is complete option.

Step 2 (Configure Job)

Now we will create a Job for deploying an application on our previously configured server from github. To Create a new job Click on New Job > Give a Name to the Job > Choose “Build a free-style software project” option > Click on “Ok”

After getting the new window Check the option “Restrict where this project can be run“. You will get a text box to enter a node name where the build will be taken place (Setup a node following the steps in my previous article). Write the node name in my case it’s “www.linuxfunda.com“. If you will not check this option then Jenkins will clone your repository in Master it self.

Jenkins-Job-2

Chose the Git Radio button from the “Source Code Management” section and write the Github Repository URL. In my case it’s “ https://github.com/tapasprivate/tapasprivate.git “.  I have described how to add Credentials in my previous article. Add the appropriate credential for the github account. Specify the branch name if you want any specific branch to clone else  it will clone “master” branch of the repository. There are also other advance options are available like git submodules which we will discuss in later articles.

Jenkins-Job-3

Step 3 (Build the Job and Verify)

Now we have done with the configuration of the job. Save the Configuration and build the job. SSH to your node where you took the build. Go to the Workspace path and verify that your files are there from github. In my next article we will configure a job with shell script.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

4 thoughts on “How to Install and configure Jenkins on CentOS 6.4 – Part III

  1. Tapas, I am waiting for your next article… I have to give you credit for posting such useful and updated Jenkins How-To article online… I am new to Jenkins however worked on Bamboo a lot.. this will be fun.. looking for your next post…

Leave a Reply