Saturday, April 5, 2014

Setting up Continous integration tool - Hudson

Follow the steps :

1) Download apache tomcat continer.

2) Setup all the environmental variables
i.e JAVA_HOME, ANT_HOME,MAVEN_HOME , HUDSON_HOME etc..

3) Download latest hudson war from
           http://hudson-ci.org/downloads/war/
 and place it into your tomcat's webapps folder.

path = apache-tomcat/webapps/hudson.war

4) Start your apache tomcat container  listening on some port eg.8080

5) visit the home page through url:

http://localhost:8080/hudson

6) On home page there will option to select multiples plugins.Select following basic required plugins and click install. It will take some time to complete:
7) Go to http://localhost/hudson/configure
here we can set system configuration.
i.e JAVA_HOME,MAVEN_HOME, etc
also set the other required things like Subversion,email settings,maven 3 settings etc

8) Setting up the job : 
a) Go to http://localhost/hudson/view/All/newJob and select first option i.e Build a free-style software job
b

b) set the svn settings to point to your project
c) set proper option to build project periodically.
eg.
* * * * * // to build per minute
*/5 * * * * to build  every 5 min
5,10,40 * * * * to build every 5,10,40 th minute of hour

d) set the maven goals for your job.
eg. clean test pmd:pmd checkstyle:checkstyle

e) setup various post build actions.


 f) click save to save the job.

g) please note that for email settings to work you need to set the JAVA_OPTS before starting the tomcat.you can set it in catalina.sh if using linux or in catalina.bat for windows.

export JAVA_OPTS=-Dmail.smtp.starttls.enable=true (for linux system)









Bye. keep Enjoying!!!

No comments:

Post a Comment