Tuesday, January 6, 2009

Setting up cruisecontrol on fedora 10 linux

Tested using cruisecontrol-bin-2.8.1.zip
Fedora 10
Java Version: openjdk and openjdk-devel rpm

I had some problems going through the Getting Started tutorial for cruisecontrol, so here is what I did to get it working. The version we're downloading works as is and you don't need to run the install.sh as suggested. Except for a few environment variables that need to be set, it's ready to go.

Step 1
As root (cause i'm lazy and don't want to type in sudo every time, also environment variables need to be viewable by the scripts and if you set them in [yourusername] they won't appear when you run the cruisecontrol service as root)

unzip cruisecontrol-bin-2.8.1.zip -d /opt/ ln -s cruisecontrol-bin-2.8.1 cruisecontrol

Step 2
These next two environment variables are necessary or else exceptions will be thrown. You will need to find your home directory for java as it's usually symlinked to the one in /usr/bin/java. I tracked Fedora's java to

lrwxrwxrwx 1 root root 22 2008-05-17 04:59 /usr/bin/java -> /etc/alternatives/java lrwxrwxrwx 1 root root 46 2008-12-07 16:21 /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java

export JAVA_HOME='/usr/lib/jvm/jre-1.6.0-openjdk.x86_64'

setenv JAVA_HOME /usr/lib/jvm/jre-1.6.0-openjdk.x86_64

Step 3
The other environment variable that needs to be set is

I recommend using the ant provided in the cruisecontrol directory. If this environment variable is not set an error like this appears:

log.xml does not exist.
The specified logger class net.sourceforge.cruisecontrol.builders.AntProgressLogger could not be used because Class not found: net.sourceforge.cruisecontrol.builders.AntProgressLogger

setenv ANT_HOME /opt/cruisecontrol/apache-ant-1.7.0

Step 4
Run cruise control
cd /opt/cruisecontrol ./cruisecontrol.sh

Step 5
This should now begin the cruisecontrol web server and you should be able to see the dashboard
Visit these URL's
http://localhost:8080/dashboard http://localhost:8080/cruisecontrol http://localhost:8080/cc-config

For some reason the current version of cruisecontrol gives a 404 error when visiting http://localhost:8080 . Older versions if cruise control redirect you to the correct place.