Jenkins continuous integration server

From Arianne
Revision as of 20:12, 24 April 2011 by imported>Hendrik Brummermann (renamed Hudson to Jenkins)
Jump to navigation Jump to search



Jenkins is an extensible continuous integration server. You can have a look at our Jenkins server with several build jobs for Stendhal, Marauroa and Marboard.


The rest of this article deals with the installation and configuration of Jenkins. If you are just interested in the results, please follow this link to our Jenkins server above.


Installation

To install and run Jenkins you just need to download the jenkins.war from the Jenkins web site and have java ready. To start the server you need a small start script that issues the following command:

java -jar jenkins.war

Once the jenkins is started, you can reach the user interface via your favourite browser if you open the following URL (assuming you have Jenkins on the same machine as your browser):

http://localhost:8080

If you see the Jenkins interface loading, you have successfully installed Jenkins.

Configuration for Stendhal

To let Jenkins 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 Jenkins, as it needs java to run)
  • CVS-Client installed

For our Jenkins we installed several plugins via the Jenkins configuration. You can see what each plugin does, if you have a look at our Jenkins or look onto the wiki at the Jenkins homepage. This list is not complete, as we still experiment with some of the plugins.

In the main configuration you have to tell Jenkins 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 Jenkins to start a build, but it tells Jenkins 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 Jenkins, we just execute three targets from the standard build.xml included in stendhal source code. We let Jenkins 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

Known Problems