Jenkins continuous integration server: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>Hendrik Brummermann
imported>Hendrik Brummermann
renamed Hudson to Jenkins
Line 3: Line 3:




Hudson is an extensible continuous integration server. You can have a look at [http://stendhal.game-host.org/hudson/ our Hudson server] with several build jobs for Stendhal, Marauroa and Marboard.
Jenkins is an extensible continuous integration server. You can have a look at [http://stendhalgame.org/jenkins/ our Jenkins server] with several build jobs for Stendhal, Marauroa and Marboard.




<div style="border: 1px solid red; padding: 1em">The rest of this article deals with the installation and configuration of Hudson. If you are just interested in the results, please follow this link to [http://stendhal.game-host.org/hudson/ our Hudson server] above.
<div style="border: 1px solid red; padding: 1em">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 [http://stendhalgame.org/jenkins/ our Jenkins server] above.
</div>
</div>




==Installation==
==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:
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 hudson.war
java -jar jenkins.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):
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
http://localhost:8080
If you see the hudson interface loading, you have successfully installed hudson.
If you see the Jenkins interface loading, you have successfully installed Jenkins.


==Configuration for Stendhal==
==Configuration for Stendhal==
To let hudson build stendhal you have to match the following prerequesites:
To let Jenkins build stendhal you have to match the following prerequesites:
* ANT installed on the same system
* ANT installed on the same system
* JDK1.5 installed (already matched if you were successfully running hudson, as it needs java to run)
* JDK1.5 installed (already matched if you were successfully running Jenkins, as it needs java to run)
* CVS-Client installed
* CVS-Client installed


For our hudson we installed several plugins via the hudson configuration. You can see what each plugin does, if you have a look at our hudson or look onto the wiki at the hudson homepage. This list is not complete, as we still experiment with some of the plugins.
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.
* [http://wiki.hudson-ci.org/display/HUDSON/Audit+Trail+Plugin Audit Trail]
* [http://wiki.jenkins-ci.org/display/JENKINS/Audit+Trail+Plugin Audit Trail]
* [http://wiki.hudson-ci.org/display/HUDSON/Checkstyle+Plugin Checkstyle Plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/Checkstyle+Plugin Checkstyle Plugin]
* [http://wiki.hudson-ci.org/display/HUDSON/Cobertura+Plugin Hudson Cobertura plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/Cobertura+Plugin Jenkins Cobertura plugin]
<!--* [http://hudson.gotdns.com/wiki/display/HUDSON/Crap4J+Plugin Hudson Crap4J plugin]-->
<!--* [http://jenkins.gotdns.com/wiki/display/JENKINS/Crap4J+Plugin Jenkins Crap4J plugin]-->
<!--* [http://wiki.hudson-ci.org/display/HUDSON/Emma+Plugin Hudson Emma plugin]-->
<!--* [http://wiki.jenkins-ci.org/display/JENKINS/Emma+Plugin Jenkins Emma plugin]-->
* [http://wiki.hudson-ci.org/display/HUDSON/Emotional+Hudson+Plugin Emotional Hudson plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/Emotional+Jenkins+Plugin Emotional Jenkins plugin]
* [http://wiki.hudson-ci.org/display/HUDSON/FindBugs+Plugin FindBugs Plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/FindBugs+Plugin FindBugs Plugin]
* [http://wiki.hudson-ci.org/display/HUDSON/Task+Scanner+Plugin Task Scanner Plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/Task+Scanner+Plugin Task Scanner Plugin]
* [http://wiki.hudson-ci.org/display/HUDSON/Warnings+Plugin Warnings Plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/Warnings+Plugin Warnings Plugin]
* [http://wiki.hudson-ci.org/display/HUDSON/Green+Balls Green Balls]
* [http://wiki.jenkins-ci.org/display/JENKINS/Green+Balls Green Balls]
* [http://wiki.hudson-ci.org/display/HUDSON/Claim+Plugin Claim Plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/Claim+Plugin Claim Plugin]
* [http://wiki.hudson-ci.org/display/HUDSON/The+Continuous+Integration+Game+plugin The Continuous Integration Game plugin]
* [http://wiki.jenkins-ci.org/display/JENKINS/The+Continuous+Integration+Game+plugin The Continuous Integration Game plugin]


In the main configuration you have to tell hudson where it can find all necessary things.
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.
At every configurable point is a small help to tell what to configure here.
Line 56: Line 56:


===Build Trigger===
===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.
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.
You also can start build at certain times not regarding changes since last build.
Line 65: Line 65:


===Build Steps===
===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.
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===
===Post Build Processing===

Revision as of 20:12, 24 April 2011



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