The Source for Java Technology Collaboration


Home | Changes | Index | Search | Go

CruiseControlSetup

Setting up a new CruiseControl? installation

Requirements

  • Linux machine (although it could work on Windows, with some tweaks to the scripts)
  • Internet access (!)
  • JDK 1.5 installation
  • Ant (to setup the environment only, CruiseControl? will use its own copy)
  • A JSP container to serve the CruiseControl? result page (http://www.javadesktop.org/cruisecontrol/)
  • A dedicated "cruisecontrol" account on the Linux system

Steps

Checkout the swinglabs/cruisecontrol module:

cvs -d:pserver:guest@cvs.dev.java.net:/cvs co swinglabs/cruisecontrol

You get the following directory structure:

\---swinglabs
    \---cruisecontrol                      ant build file to deploy the CruiseControl setup
        +---conf                           the project configuration
        +---redist                         ant, cobertura and cruisecontrol archives
        \---support                        scripts, xsl, jsp used by the build loop
            \---cruisecontrol-web
                \---WEB-INF
                    \---lib

Copy the file build.properties.default to build.properties, edit the file to match your environment.

cd swinglabs/cruisecontrol
cp build.properties.default build.properties
vi build.properties

Execute the ant script to deploy the CruiseControl? setup:

ant deploy
It creates a directory named "build" under "swinglabs/cruisecontrol" with the following content:
\---swinglabs
    \---cruisecontrol
        +---build
        |   +---cruisecontrol
        |   |   +---apache-ant-1.6.5
        |   |   +---cobertura-1.4
        |   |   +---cruisecontrol-2.3.0.1
        |   |   +---logs
        |   |   +---logs-private
        |   |   +---projects
        |   |   |   \---lib
        |   |   \---web
        |   |       \---cruisecontrol
        |   \---stats

From now on, I will be referring to the build/cruisecontrol directory as CC_DIR.

At this point, CruiseControl? is installed but is not yet configured to build projects. With a standard CruiseControl? setup, you have to write a config.xml file which describes the projects to build, how often to build them, how to update them, how to compile them, who and how to notifiy when build fails. For our case, this would just be a copy/paste work as all projects share the same setup. So the chosen approach is a little bit different.The projects which are going to be built by CruiseControl? are listed into the file conf/projects.xml. This is not the standard CruiseControl? config file. This file lists the projects, for each project which version (tag, branch) of the project to build, and additional properties which may be passed to the build. The xml file is processed by a stylesheet to create the actual CruiseControl? configuration.

Generate the CruiseControl? configuration:

ant update
This step has to be executed whenever a new project or new branch needs to be added to the build loop. It copies conf/projects.xml to the deployment directory, checkout the projects/branches, generate the CruiseControl? configuration. The project checkouts are under CC_DIR/projects.

Time as shown that after some weeks or even only days sometime, the CruiseControl? loop just hangs which checking for CVS modifications. To circumvent this, CruiseControl? is (re)started by a crontab process every day at 4:00am. To register the crontab job:

crontab CC_DIR/crontab.time
Every day at 4:00am, the script CC_DIR/crontab.sh will be executed. This script kills all running java processed (only those of the "cruisecontrol" user), starts the CruiseControl? loop and runs a cleanup script. The goal of this cleanup script is to remove old CruiseControl? log files under CC_DIR/logs.

Adding a new project or branch

Edit the file conf/projects.xml. Run

cd swinglabs/cruisecontrol
ant update

Restart the CruiseControl? loop.

CC_DIR/crontab.sh

HELP You will need to make executable all scripts within the checkout and build directory. This includes all "*.sh" and "ant" executables.

Forum Posts

Here I'm listing interesting forum posts related to our CruiseControl? setup:

TODO

  • Document the build.xml, build-cc.xml, how they work, why they exist

Topic CruiseControlSetup . { Edit | Ref-By | Printable | Diffs r1 | More }
 XML java.net RSS

Revision r1 - 25 May 2006 - 17:34:49 - Main.l2fprod