Jenkins continuous integration server
Hudson is an extensible continuous integration server. You can have a look at our current hudson server with several build jobs for Stendhal, Marauroa and Marboard here.
Installation
To install and run Hudson you just need to download the hudson.war from the hudson web site and have java ready. To start the server you need a small start script that issues the following command:
java -jar hudson.war
Once the hudson is started, you can reach the user interface via your favourite browser if you open the following URL (assuming you have hudson on the same machine as your browser):
http://localhost:8080
If you see the hudson interface loading, you have successfully installed hudson.
Configuration for Stendhal
To let hudson build stendhal you have to match the following prerequesites:
- ANT installed on the same system
- JDK1.5 installed (already matched if you were successfully running hudson, as it needs java to run)
- CVS-Client installed
In the main configuration you have to tell hudson where it can find all necessary things.
At every configurable point is a small help to tell what to configure here.
Setup a build job for Stendhal
The next steps show, how to configure a basic build job for stendhal.
Source Code Management System
Just select CVS and configure the following parameters:
- CVS-Root
- :pserver:anonymous@arianne.cvs.sourceforge.net:/cvsroot/arianne
- Module
- stendhal
- Branch
- leave this empty if you want to build HEAD.
- or choose a branch name to build
Build Trigger
Here you configure, when a build is started. Our current way of triggering builds is triggered from CVS at a certain time. This means not, the CVS tells hudson to start a build, but it tells hudson to check regularly the CVS for changes and builds, when there were commits since last build.
You also can start build at certain times not regarding changes since last build.
For both of this options you have to provide a cron like notation, when to check/build. At the moment, we check every day at 5 am and build then.
The other options allow it to start a build via URL or let a build start, if another build was finished.
Build Steps
To build Stendhal with hudson, we just execute three targets from the standard build.xml included in stendhal source code. We let hudson first call clean run_tests_with_cobertura. This first cleans the workspace and starts a complete build including coverage measurement. Afterwards we start java_doc which generates a fresh api documentation from stendhal.
Post Build Processing
After a build was successful certain steps follow to produce those nice looking reports and graphics. For stendhal we use several reports to publish.
- java doc
- check this option to publish the generated java docs
- provide api as directory for the docs
- junit test results
- check this option to publish the results
- provide build/build_test_report/testresults.xml as location for the junit report in xml format
- cobertura
- this option allows us to publish the results of the test coverage
- provide build/cobertura_report/*.xml as report file
- To do report
- Warnings