Introduction

The CruiseControl machine is the machine that runs CruiseControl and all maven build processes automatically. The build process fetches the source from the SF CVS. The build process builds, deploys to localhost and runs all tests. The build process deploys the Maven JavaCareers site to the SF site.

Suse Linux supports visual remote administration if it is enabled with Yast2/Services/Remote administration on vnc:/MACHINE_IP:1.

First read Build setup, as some issues described in there are taken for granted.

Configure CruiseControl

Maven can generate the CruiseControl configuration.

  1. Use the RPM's (if available) to install MySQL (for the test cases), Tomcat and CruiseControl on the CruiseControl machine. Create a startup script in /etc/init.d based on /etc/init.d/skeleton if there is no RPM.
  2. Verify that $JAVA_HOME, $MAVEN_HOME and $PATH are correct. Edit ~/.bashrc if necessary. The Java home should point to a JDK, not a JRE. You might want to set $MAVEN_OPTS to -Xmx512m or more. Make sure the ssh-agent is booted. An example of the ~/.bashrc profile script:

    export JAVA_HOME=/usr/lib/java
    export MAVEN_HOME=/home/cruisecontrol/maven
    export PATH=$PATH:$MAVEN_HOME/bin
    export MAVEN_OPTS="-Xmx1024m"
    # Boot the ssh agent
    ssh-agent > ~/.ssh/agent-info
    . ~/.ssh/agent-info
                        
  3. Make a directory CRUISECONTROL_HOME/checkout and checkout the project in that checkout directory, which results into CRUISECONTROL_HOME/checkout/javacareers.
  4. Copy the project's example.build.properties to build.properties in the same directory if you haven't done so already and edit the later. Make sure you have run javacareers:build at least once succesfully.
  5. Verify that the cruisecontrol properties in project.properties are correct. Do not edit them on the CruiseControl machine as they are not local and the CruiseControl machine must not commit anything.
  6. maven cruisecontrol:configure cruisecontrol:install-local
  7. Verify that CRUISECONTROL_HOME/config.xml is correct. If you edit it, document it in this xdoc.
  8. Edit CRUISECONTROL_HOME/reporting/jsp/webcontent/xsl/maven.xsl to limit the size of the cruisecontrol e-mails:

                            <xsl:template match="mavengoal" mode="maven">
                            <xsl:if test="./message[@priority='error']">
                            <tr class="compile-sectionheader">
                            <td>
                            <xsl:value-of select="@name"/>
                            </td>
                            </tr>
                            <tr>
                            <td>
                            <xsl:apply-templates select="./message" mode="maven"/>
                            </td>
                            </tr>
                            </xsl:if>
                            </xsl:template>
                        
  9. Verify that CRUISECONTROL_HOME/main/bin/cruisecontrol.sh is correct. You might want to add -Xm512m or more as java options.
  10. Change to the directory CRUISECONTROL_HOME and execute main/bin/cruisecontrol.sh in that directory.

Known issues

  • If the multiproject's project.xml is commited with a dependency that doesn't exist in the repository and the solution doesn't involve creating this dependency in the repository, then CruiseControl will never recover from a build failure. This because maven 1 doesn't allow the scm:update-project goal to be run if the dependencies aren't satisfied.
  • If the version number changes in the POM, a manual build (without a clean) must be doen on the cruisecontrol machine because a clean requires the dependencies to be satisfied.