Contents
- 1 What is Cruise Control?
- 2 installing CruiseControl
- 3 Sample Config.xml File
- 4 Config.xml File explained
What is Cruise Control?
CruiseControl is a framework for a continuous build process. It includes, but is not limited to, plugins for email notification, Ant(refer ‘Basics Of Ant Script Tool’ and various source control tools. A web interface is provided to view the details of the current and previous builds.
CruiseControl is composed of 3 main modules:
1. The build loop
2. The legacy reporting
3. The dashboard
1. The build loop:The Build loop triggers the build cycles and notifies the users about the status of build. This is configured in build config file(default:config.xml). Artifacts(ouputs) are also created and copied over to specified location.
2. The legacy reporting:This allows the users to browse the results of the builds and access the artifacts.
3. The dashboard:This provides the visual representation to all build statuses and artifacts.
installing CruiseControl
1. Cruise control is a sourceforge project
2. Extract the zip file into a directory
3. run the bash script in the cruisecontrol directory. cruisecontrol.jar will be created . Copy the file over to tomcat webapps directory ,and restart tomcat.
Sample Config.xml File
<cruisecontrol>
<project name="sample_project">
<bootstrappers>
<currentbuildstatusbootstrapper
file="sample_project_currentbuild.txt" />
<cvsbootstrapper cvsroot=":pserver:username:/cvsroot"
file="sample_project/build.xml" />
</bootstrappers>
<modificationset quietperiod="180"
dateformat="yyyy-MMM-dd HH:mm:ss">
<cvs cvsroot=":pserver:username:/cvsroot"
localworkingcopy="sample_project"/>
</modificationset>
<schedule interval="600" intervaltype="relative">
<ant buildfile="sample_project/build.xml"
target="integration.clean" multiple="5" />
<ant buildfile="sample_project/build.xml"
target="integration" multiple="1" />
</schedule>
<log dir="sample_project">
<merge dir=sample_project/junit"/>
</log>
<publishers>
<currentbuildstatuspublisher
file="sample_project_currentbuild.txt" />
<email mailhost="our-mail-host"
returnaddress="test@domain.com"
defaultsuffix="@domain.com"
buildresultsurl="http://k2:8080/sample_project/buildresults">
<always address="buildmasters" />
<failure address="developers" />
<map alias="developer1"
address="developer1@othercompany.com" />
<map alias="buildmasters" address="test" />
<map alias="developers" address="test,
localdeveloper, developer1" />
</email>
</publishers>
</project>
</cruisecontrol>
Config.xml File explained
Project -A project is defined using <project> tag. A number of projects can be defined in a single project
Bootstrappers -These files will be run when cruise control build is triggered. Build takes place after bootstrapping is successful
Modificationset-Changes in localdirectory and CVS will be caught in modificationset tag. If there is change in CVS after last build , It will trigger next build. quiet time period and location of the project can be explicitly specified. The localworkingcopy attriburte decides location of the project code that has been checked out. quite time period defines the time limit for the next build in case user has done a CVS checkin in between.
Schedule-The Automated build can be scheduled in schedule tag. Target to be run can also be spcified.
Log-All the build logs are stored in the location specified in log tag.
Publishers-Publishers tag spcifies the location where the build artifacts are to be put. users can also be notified by giving the email addresses in this tag.