Getting started with Hudson

Hudson is a slick, stable, and easy to install continuous integration environment. You’ll be using it in minutes. Honest.

Install Java

Hudson is a java webapp. Ubuntu comes with Sun’s JVM installed by default, so this is a no-op.

Download and Install Hudson

mkdir -p ~/.hudson
cd ~/.hudson
wget http://hudson-ci.org/latest/hudson.war
java -jar ~/.hudson/hudson.war --httpPort=9000 &

You should see something like this:

Running from: /Users/mrm/.hudson/hudson.war
[Winstone] - Beginning extraction from war file
...
INFO: Completed initialization

If you don’t, you should check the documentation on the hudson wiki.

Create your first Hudson Job

Go to http://localhost:9000, and create a new “job” — jobs hold the build instructions for a project. They can be built from N build commands and N source code repositories, and have N final artifacts.

There are two main configuration items to concentrate on:

  1. where hudson should get your code, and
  2. how it should do a build.

The where is configured in the “Source Code Management” section. The how is configured in the “Build” section. You’ll want to click “Add build step” and choose the appropriate option.

Most likely you want it to rebuild your project whenever someone commits changes. If you aren’t familiar with cron, it might be a bit confusing. “*/5 * * * *” means poll every 5 minutes (whenever the minute value is evenly divisible by 5), like so:

Kudos to the developers!

Related posts:

  1. How to increase maven heapspace in hudson builds
    If your maven-built project fails in hudson (especially when you’re using the assembly plugin) and it isn’t a compile or test failure, check the console output. If it says “java.lang.OutOfMemoryError:......
  2. How to add a version number to your hudson-built maven jar
    Maven’s jar plugin will automatically add a “pom.properties” in your jar’s META-INF/maven/$groupId/$artifactId directory. If you build with hudson, there are a number of other values that you might want to......
  3. Tips with iWork Pages
    If you’re writing a book, new chapters need to start on the top of the next right page. To do this in openoffice, you Insert > Break, choose “Page”, then......
  4. How to add a version number to your maven webapp
    I couldn’t find a simple recipe to add a version number to a maven-built webapp. The maven-war-plugin talks about how to filter, but no simple example is given. So. I’ll......

  • Eman Azmy

    When I check “Publish JUnit test result report”, I got this error
    ” Test reports were found but none of them are new. Did tests run? “

  • Eman Azmy

    Hello,
    Having some trouble with running JUnit test cases, I got this error after building

    Test reports were found but none of them are new. Did tests run?
    For example, C:Documents and Settingseman.azmy.hudsonjobsEman First JobworkspaceMItesting.xml is 52 sec old

    Best Regards,
    Eman Azmy