Friday 26 April 2013

Jenkins CI - Intro

I find CI tools like Jenkins extremely helpful in any project which is serious about quality. It enforces the whole team into a mindset were everyone works towards a common goal of keeping Jenkins report clean!

This blog will touch upon getting Jenkins up and running with couple of jobs.

Installing Jenkins

I would be running Jenkins under Tomcat container. I tested that my tomcat container is up and running by going to http://localhost:8080. If its not running for you, please get it running first.

Once tomcat is up, place jenkins.war file (which you can find on Jenkins website) in the webapps directory in my CATALINA_HOME and that's done.

Jenkins should be up and running at http://localhost:8080/jenkins

Configuring Jenkins

There are a few recommended configuration items that I quickly setup. All this configuration can be done by clicking 'Manage Jenkins'.

Set up JDK

Add your JAVA_HOME path.

 

Setup up Maven

Add your MAVEN_HOME path.
There are other configuration items like Ant, Email etc however above 2 should get us started straight away.

Plugins

Since my test projects are on git hub and Jenkins does not come by default with Git, I need to install the Git Plugin, installing which is super easy via the  'Manage Jenkins' -> 'Manage Plugins' tab. Just search for 'Git Plugin' and select install.

 

Setting up first job

Setting up a job is pretty easy as well. Select 'New Job' and click 'Build a free-style software project' which will allow me to choose the git repository for my projects.

  • Give the Git Repository URL.
  • Select a Build Trigger which I want to be random minute every hour.
  • Invoke top-level Maven target. 


  •  Add a post build action of publishing Junit test reports.




Save changes and in some time your first job would be run buy Jenkins and a fantastic dashboard view of all my projects is available to me with a setup of barely 15 mins. This to me is great power of Jenkins.


This blog does not contain usage of any advanced features of Jenkins, but show that even with few basic setup steps Jenkins can be used to make big leaps in get CI with your existing automated test cases.

No comments:

Post a Comment