Saturday, 14 December 2013

Setup Jenkins Continuous and Automatic Build System

Jenkins is an open source tool which provides continuous integration services for software development. If you want to get more detail about Jenkins and it's history I would suggest refer this link. This post will help you installing and configuring Jenkins and creating jobs to trigger maven builds. Setting up Jenkins is not a rocket science indeed. In this post, I would like to concise the installation and configuration steps.


Installing Jenkins
Though, there are different ways to install Jenkins. But, in this post I will be describing Jenkins installation with Apache Tomcat server. Hence, please make sure that you have Apache Tomcat.   
  1. Download Jenkins war file from here and copy war into tomcat's 'webapp' folder
  2. Start the tomcat server and access Jenkins

Jenkins installation is done. Wow, so easy. Isn't it?

Configuring Jenkins
Now you have Jenkins running with you. It's time to configure the project specific environment for continuous and automatic build. This section describes about JDK, Maven and Mail Notification configuration.

Go to 'Manage Jenkins

 

Go to 'Manage Jenkins > Configure System'




Creating Job for Automatic and Continuous Build
So far you installed and configured  the Jenkins. It's time to create new job. Before creating new job ensure that your project is a maven project. Now, go to 'New Job' and fill the required information. believe, below screen shot tells everything which is required to configure a job. You just need to configure below points at minimum:
  • Source Code Management
  • Build Triggers
  • Build
  • Notifications





Once you save the job you will see below screen


Now click on 'Build Now' and see the 'Build History'. You will get new entry in 'Build History'. To see the build logs just hover the mouse on this build and click on 'Console Output', you can see the build logs.



Congratulations! you are done with setting up continuous build system.If you want to see that how effectively it works, just check-in any file in your project and see whether your build is triggered automatically. In case, build is failed with latest checked-in changes you must get a notification mail saying build is failed.

Last but not least, you should agree with my point 'Setting up Jenkins is not a rocket science indeed'. Shouldn't you? :) :) :)