CruiseControl

CruiseControl is a framework for a continuous build process. It includes, but is not limited to, plugins for email notification, Ant, Maven, and various source control tools(CVS, Subversion). A web interface is provided to view the details of the current and previous builds.

Prerequisites:

You have to have the following installed:

  • Java 1.5
  • Ant 1.6.5 or later
  • Maven 1.0.2
  • Subversion 1.3.x or 1.4.x

Getting the CruiseControl source code:

Unpack the downloaded cruisecontrol source. I place it in ~/local/

  • cd ~/local
  • unzip cruisecontrol-src-2.6.zip

Making sure ant has access to junit.jar

  • mdkir -p ~/.ant/lib

Download junit from here:

After unzipping the file, locate junit-4.1.jar and copy it to:

  • ~/.ant/lib

Now, go to the curiscontrol directory and build it:

  • cd ~/local/cruisecontrol-2.6/
  • ant

The build will take a couple of minutes. In order to test the build, execute:

  • java -jar ~/local/cruisecontrol-2.6/main/dist/cruisecontrol-launcher.jar
  • It should show a bunch of usage messages

Setting up and running the Build Loop

  • First we need to setup the work directories
  • mkdir -p ~/local/work/cruise
  • cd ~/local/work/cruise
  • mkdir checkout
  • mkdir logs
  • mkdir artifacts

Checking out Sakai

Configure the Build Loop

  • Create a configuration file called "config.xml" in ~/local/work
  • <cruisecontrol>
      <project name="sakai_2-3-x" buildafterfailed="true">
        <listeners>
          <currentbuildstatuslistener
              file="logs/sakai_2-3-x/status.txt"/>
        </listeners>
    
        <!-- Bootstrappers are run every time the build runs,
            *before* the modification checks -->
        <bootstrappers>
    	<svnbootstrapper localWorkingCopy="checkout/sakai_2-3-x"/>
        </bootstrappers>
        
        <!-- Defines where cruise looks for changes, to decide
             whether to run the build -->
        <modificationset quietperiod="10">
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/site-management/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/login/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/test-harness/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/jobscheduler/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/providers/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/ucd-enterprise-data-service/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/ucd-form-based-distauth/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/melete/branches/melete_2-3"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/sam/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/component/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/portal/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/help/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/site-manage/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/master/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/tool/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/reference/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/authz/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/gradebook/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/util/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/courier/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/event/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/entity/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/velocity/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/user/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/memory/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/db/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/email/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/alias/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/site/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/access/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/content/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/metaobj/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/presence/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/calendar/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/jsf/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/sections/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/course-management/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/archive/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/rwiki/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/search/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/announcement/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/mailarchive/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/chat/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/discussion/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/message/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/web/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/osid/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/webservices/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/assignment/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/profile/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/dav/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/roster/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/syllabus/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/presentation/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/textarea/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/samples/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/msgcntr/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/postem/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/cluster/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/rights/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/blog/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/linktool/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/privacy/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/podcasts/branches/sakai_2-3-x"/>
        </modificationset>
    
        <!-- Configures the actual build loop, how often and which
             build file/target -->
        <schedule interval="600">
    	<maven mavenscript="/usr/local/maven/bin/maven"
            	projectfile="checkout/sakai_2-3-x/project.xml"
            	goal="bld"/>
        </schedule>
    
        <!-- directory to write build logs to -->
        <log logdir="logs/sakai_2-3-x"/>
    
        <!-- Publishers are run *after* a build completes -->
        <publishers>
    	<email mailhost="smtp.ucdavis.edu"
            	returnaddress="tpamsler@ucdavis.edu"
            	buildresultsurl="http://euler.ucdavis.edu:8080/cruisecontrol/buildresults/sakai_2-3-x"
            	skipusers="true"
    		spamwhilebroken="true">
        		<always address="tpamsler@ucdavis.edu"/>
        		<failure address="tpamsler@ucdavis.edu"/>
    	</email>
        </publishers>
      </project>
    
      <project name="sakai_mini_2-3-x" buildafterfailed="true">
        <listeners>
          <currentbuildstatuslistener
              file="logs/sakai_mini_2-3-x/status.txt"/>
        </listeners>
    
        <!-- Bootstrappers are run every time the build runs,
            *before* the modification checks -->
        <bootstrappers>
    	<svnbootstrapper localWorkingCopy="checkout/sakai_mini_2-3-x"/>
        </bootstrappers>
    
        <!-- Defines where cruise looks for changes, to decide
             whether to run the build -->
        <modificationset quietperiod="10">
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/site-management/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/login/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/test-harness/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/jobscheduler/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/providers/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/ucd-enterprise-data-service/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/ucd-form-based-distauth/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/melete/branches/melete_2-3"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/sam/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/component/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/portal/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/help/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/site-manage/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/master/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/tool/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/reference/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/authz/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://mware.ucdavis.edu/svn/ucd-sakai/gradebook/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/util/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/courier/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/event/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/entity/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/velocity/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/user/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/memory/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/db/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/email/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/alias/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/site/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/access/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/content/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/metaobj/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/presence/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/calendar/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/jsf/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/sections/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/course-management/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/archive/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/rwiki/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/search/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/announcement/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/mailarchive/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/chat/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/discussion/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/message/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/web/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/osid/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/webservices/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/assignment/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/profile/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/dav/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/roster/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/syllabus/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/presentation/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/textarea/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/samples/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/msgcntr/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/postem/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/cluster/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/rights/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/blog/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/linktool/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/privacy/branches/sakai_2-3-x"/>
            <svn RepositoryLocation="https://source.sakaiproject.org/svn/podcasts/branches/sakai_2-3-x"/>
        </modificationset>
    
        <!-- Configures the actual build loop, how often and which
             build file/target -->
        <schedule interval="600">
          	<maven mavenscript="/usr/local/maven/bin/maven"
            	projectfile="checkout/sakai_mini_2-3-x/project.xml"
            	goal="bld"/>
        </schedule>
    
        <!-- directory to write build logs to -->
        <log logdir="logs/sakai_mini_2-3-x"/>
    
        <!-- Publishers are run *after* a build completes -->
        <publishers>
    	<email mailhost="smtp.ucdavis.edu"
            	returnaddress="tpamsler@ucdavis.edu"
            	buildresultsurl="http://euler.ucdavis.edu:8080/cruisecontrol/buildresults/sakai_mini_2-3-x"
            	skipusers="true"
    		spamwhilebroken="true">
        		<always address="tpamsler@ucdavis.edu"/>
        		<failure address="tpamsler@ucdavis.edu"/>
    	</email>
        </publishers>
      </project>
    
    </cruisecontrol>
    

Start the Build Loop

  • cd ~/local/work/cruise
  • chmod 755 ~/local/cruisecontrol-2.6/main/bin/cruisecontrol.sh
  • ~/local/cruisecontrol-2.6/main/bin/cruisecontrol.sh

Running the Reporting Application