Source: http://www.vogella.de/articles/ContinuousIntegration/article.html
Continuous Integration with Hudson - Tutorial
Version 0.5
Copyright © 2008 -2009 Lars Vogel
02.02.2010
Table of Contents
Continuous integration is a process in which all development work is integrated at a predefined time or event and the resulting work is automatically tested and build. The idea is that development errors are identified very early in the process.
Hudson is one open source tool to perform Continuous Integration. The basic functionality of Hudson is to monitor a SCM (Source Control System) and if changes occurs to start and monitor a build system (for example Apache Ant or Maven). Hudson will monitor the whole process and provide reporting functionality and notification functionality to report success or errors.
Hudson can be extended by additional plugins.
To use Hudson you need:
-
An accessible source code repository, e.g. subversion, with your code checked in.
-
A working build script, e.g. ant script, checked into the respository
-
A webapplication server, e.g. Tomcat, to run Hudson
Tip
Hudson works also without webapplication server but I focus on the more common case.
Install Tomcat. See Apache Tomcat Tutorial .
For the usage of Hudson you need to setup Apache Ant as a build tool. See Using Apache Ant for details.
Download the "hudson.war" file from Hudson Homepage and put the it into your Tomcat "webapps" directory. If you start Tomcat your Hudson installation should be available under "http://localhost:8080/hudson/".
Before using hudson you need to tell it where your JDK and ant installation is. Go to Hudson under "http://localhost:8080/hudson/" and click "Manage Hudson" and then "Configure System"
Maintain the correct path to your JDK and Ant installation and press "Save" below.
See Hudson FAQ for a description how to configure the http proxy for svn in Hudson.
Hudson supports out of the box subversion and cvs but you find Hudson connectors for almost every SCM system.
The following will use svn as an example. You specify the svn URL during project setup.
Select "New Job" and select "Freestyle Job".
Select "subversion" and maintain your svn URL. The system will give an error message that you need to maintain the credential. Click on the link and maintain your user and password.