[#1259] CruiseControlJava
Setting up GForge's CruiseControl? integration
CruiseControl? is a framework for continuous build process. The integration with GForge AS includes real-time build status for and automatic opening of bug tickets, and it’s accomplished by installing a GForge Publisher Plugin in the build machine. CruiseControl? integration for GForge AS is based on the creation of “Build Configurations”. Each “Configuration” is a simple set of rules that will be applied when that particular “Build” fails. Basically, a new Tracker Item is created on the selected Tracker, by the selected Submitter, and is assigned to the selected Assignees.
Setting up the CruiseControl? extension
We’ll be using CruiseControl? v2.5 for this setup. First, copy the .jar files from /opt/gforge5/plugins/cruisecontrol/lib/jar into your CruiseControl? lib folder.
Then, you will need to edit the launcher script used to start CruiseControl?. If you’re on Windows you’ll have to edit cruisecontrol.bat, otherwise edit cruisecontrol.sh.
Windows - Cruisecontrol.bat:
Add the following lines at the appropriate location:
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\axis.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\jaxrpc.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\wsdl4j-1.5.1.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\commons-codec-1.3.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\commons-discovery-0.2.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\commons-httpclient-3.0-rc3.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\crimson.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\saaj.jar
set CRUISE_PATH=%CRUISE_PATH%;%LIBDIR%\gforge-external-publisher.jar
UNIX - Cruisecontrol.sh:
Add the following text to CRUISE_PATH (all in the same line):
:$LIBDIR/axis.jar:$LIBDIR/jaxrpc.jar:$LIBDIR/wsdl4j-1.5.1.jar:$LIBDIR/commons-codec-1.3.jar:$LIBDIR/commons-discovery-0.2.jar:$LIBDIR/commons-httpclient-3.0-rc3.jar:$LIBDIR/crimson.jar:$LIBDIR/saaj.jar:$LIBDIR/gforge-external-publisher.jar
Setting up the GForge server
First, we must configure GForge’s CruiseControl? plugin for CruiseControl? integration. The CruiseControl? plugin is part of the distribution of GForge Advanced Server, and it can be easily set up in these steps:
- Log into the GForge server as the root user and create the directory /etc/gforge/plugins/cruisecontrol:
# mkdir /etc/gforge/plugins/cruisecontrol - Copy the file /opt/gforge5/plugins/cruisecontrol/conf/cruisecontrol.conf to /etc/gforge/plugins/cruisecontrol:
# cp /opt/gforge5/plugins/cruisecontrol/conf/cruisecontrol.conf /etc/gforge5/plugins/cruisecontrol - Edit the new copy of cruisecontrol.conf so that the “hash” variable has a random string of characters of any length which will be used for authentication (this is randomly done at install time, but you can change it if you want). A minimum of 20 characters is recommended. The file should look like this:
<?php
$config'hash'? = '2bYcZFPcTaqaZBhaCLFPgkk7aBK19Xk09im8XbjQ'; // Change this to a random string
?> - Re-generate GForge’s configuration cache:
# /opt/gforge5/bin/create_config_cache.php
Setting up the GForge project
To enable CruiseControl? support for a GForge project, go to the project’s admin page and enable the CruiseControl? checkbox on the “Plugin Admin” box. Click “Submit” to activate the plugin. When the plugin is activated, a new option, “CruiseControl? Admin” will show up on the project’s Admin page. From this page, you can create new CruiseControl? configurations for the project.
A CruiseControl? configuration lets you configure what action to take if a build fails. When this happens, a new tracker item is automatically opened on the specified tracker, and it is assigned to the users you select.
Setting up a configuration
Once you’ve created a configuration, you’ll have to configure the CruiseControl? client to interact with this configuration. On the CruiseControl? Admin page, you’ll see the list of the configurations, and next to each configuration you’ll find the option to download either the Java config (for the Java version of CruiseControl?) or .NET config (for CruiseControl?.NET).
Setting up Java CruiseControl?
Go to the CruiseControl? directory and open the file “config.xml” on your editor. Then, on the GForge admin page, click on the “Get Java Config” link for the configuration. You will be directed to a page with two text boxes. Paste the contents of the first text box right after the opening <cruisecontrol> tag in config.xml, and make sure this text is not inside any <project> tag, otherwise the plugin won’t work!
Then, go to the appropriate <project> section and, inside it, paste the contents of the second textbox in the GForge page (the one that starts with “<publishers>”). There may already be a <publishers> section inside your project’s configuration, in that case just ignore it and put the contents of the GForge textbox right after the closing </publishers> tag.
After making these changes, wait for a new build of the project. If everything was set up correctly, the results of the builds will show up on the “Build” section of your GForge project.
Delete Page Lock Page Edit this pagePrint Version




