Tuesday, March 11, 2014

How to set up Jenkins in your local development environment?

today i am going to discuss how to set up jenkins in your local machine. in oder to do that, you can follow the steps given below.


1. Install Apache Tomcat Server.

2. Download jenkins.war file from the http://jenkins-ci.org and deploy it in the tomcat server. (webapps)

3. Once the jenkins.war file was deployed successfully, you can open jenkins web console from the following url.
http://localhost:8080/jenkins


4. Now we need to configure Jenkins to use Java, Maven and Ant for building the projects.
    for most of the time, i prefer to build maven based projects. i am not a fan of Ant anymore ;)
    therefore i am going to configure Only Maven and Java. this can be done as follows.

   Manage Jenkins => Configure System




JDK Configurations

setting up the java home.




Maven Configurations

setting up the maven home




Now we have done the most of the required configurations for the jenkins.

Now it is gpood time to install some important/required plugins  for the jenkins.
i prefer to build the application form the Git repository. that is the Source Code Management and Versioning tool i have been using for more than 4 years. so i need to install that plugin for the Jenkins. that can be done as follows.

   Manage Jenkins => Manage Plugins


then install the Git-Plugin . you may see that plugin in the tab called "Available".

once the plugin is installed, your jenkins set up is done and it is  good time to test with first build.


First we will try to build maven web project from following GitHub url.

https://github.com/chathurangat/jax-ws-server-side-soap-handler


First we need to create a New Job for that purpose. that can be created By Clicking on the New Item in the left menu.


then you will get the folowing screen



Give a Name for the Build under Item Name.

Since i am going to build a maven based project, i am going to select the Maven Project option.


Then you need to select the JDK version that should be used  for the build.

Under  Source Code Management select the Git as SCM and configure the parameters accordinghly. refer the below screenshot.


Once SCM is added, you need to save the whole configurations before leaving the page.


then you will see the list of availble, build jobs in the Jenkins dashboard and you can execute the build job as required.

build history link can be used to check the status of the build job.

In next article, i am going to demostrate how to automate the deploy process in tomcat with Jenkins.



Thanks
Chathuranga Tennakoon
www.chathurangaonline.com

3 comments: