CruiseControl Configuration Reference
CruiseControl configuration files are written in XML. This document describes the XML elements and attributes for a valid configuration file.
The use of plugins means that other
elements not documented here can also be used in the configuration.
At a minimum, though, the config file contains a single top level
<cruisecontrol>
element, with one or more child
<project>
elements.
Alphabetical Index
<accurev> <accurevbootstrapper> <alienbrain> <alienbrainbootstrapper> <alwaysbuild> <ant> <antbootstrapper> <antpublisher> <artifactspublisher> <bootstrappers> <composite> <buildstatus> <clearcase> <clearcasebaselinepublisher> <clearcasebootstrapper> <clearcaseviewstrapper> <cmsynergy> <cmsynergybaselinepublisher> <cmsynergybootstrapper> <cmsynergysessionmonitor> <cmsynergytaskpublisher> <compound> <cruisecontrol> <currentbuildstatusbootstrapper> <currentbuildstatusftpbootstrapper> <currentbuildstatusftplistener> <currentbuildstatusftppublisher> <currentbuildstatuslistener> <currentbuildstatuspagelistener> <currentbuildstatuspublisher> <cvs> <cvsbootstrapper> <dateformat> <delete> <email> <exec> <execbootstrapper> <execute> <filesystem> <forceonly> <ftppublisher> <gzip> <harvest> <htmlemail> <httpfile> <include.projects> <jabber> <labelincrementer> <listeners> <lockfilebootstrapper> <lockfilelistener> <log> <maven> <maven2> <mavensnapshotdependency> <maven2snapshotdependency> <merge> <mks> <modificationset> <nant> <phing> <onfailure> <onsuccess> <p4> <p4bootstrapper> <pause> <plasticscm> <plasticscmbootstrapper> <plugin> <plugin> <project> <property> <publishers> <pvcs> <rss> <sametimeannouncement> <schedule> <scp> <sfeedocman> <sfeefrs> <sfeetracker> <snapshotcm> <snapshotcmbootstrapper> <socket> <starteam> <starteambootstrapper> <surround> <surroundbootstrapper> <svn> <svnbootstrapper> <targets> <timebuild> <threads> <triggers> <ucm> <veto> <vss> <vssbootstrapper> <vssjournal> <weblog> <x10> <xsltlogpublisher> <yahoopublisher>
Hierarchical Index
<cruisecontrol> <property/> <include.projects/> <system> <configuration> <threads/> </configuration> </system> <plugin/> <project> <property/> <plugin/> <dateformat/> <labelincrementer/> <listeners> <cmsynergysessionmonitor/> <currentbuildstatusftplistener/> <currentbuildstatuslistener/> <currentbuildstatuspagelistener/> <lockfilelistener/> </listeners> <bootstrappers> <accurevbootstrapper/> <alienbrainbootstrapper/> <antbootstrapper/> <clearcasebootstrapper/> <clearcaseviewstrapper/> <cmsynergybootstrapper/> <currentbuildstatusbootstrapper/> <currentbuildstatusftpbootstrapper/> <cvsbootstrapper/> <execbootstrapper/> <lockfilebootstrapper/> <p4bootstrapper/> <plasticscmbootstrapper/> <snapshotcmbootstrapper/> <starteambootstrapper/> <surroundbootstrapper/> <svnbootstrapper/> <vssbootstrapper/> </bootstrappers> <modificationset> <accurev> <alienbrain/> <alwaysbuild/> <buildstatus/> <clearcase/> <cmsynergy/> <compound> <targets/> <triggers/> </compound> <cvs/> <filesystem/> <forceonly/> <harvest/> <httpfile/> <mavensnapshotdependency/> <maven2snapshotdependency/> <mks/> <p4/> <plasticscm/> <pvcs/> <snapshotcm/> <starteam/> <surround/> <svn/> <timebuild> <ucm> <veto/> <vss/> <vssjournal/> </modificationset> <schedule> <ant/> <maven/> <maven2/> <pause/> <nant/> <phing/> <exec/> <composite/> </schedule> <log> <merge/> <gzip/> <delete/> </log> <publishers> <antpublisher/> <artifactspublisher/> <clearcasebaselinepublisher/> <cmsynergybaselinepublisher/> <cmsynergytaskpublisher/> <currentbuildstatuspublisher/> <currentbuildstatusftppublisher/> <email/> <execute/> <ftppublisher/> <htmlemail/> <jabber/> <onfailure/> <onsuccess/> <rss/> <sametimeannouncement/> <scp/> <sfeedocman/> <sfeefrs/> <sfeetracker/> <socket/> <weblog> <x10/> <xsltlogpublisher/> <yahoopublisher/> </publishers> </project> </cruisecontrol>
<cruisecontrol>
<cruisecontrol>
The <cruisecontrol>
element is the root element
of the configuration, and acts as a container to the rest of the
configuration elements.
Child Elements
Element | Cardinality | Description |
---|---|---|
<system> | 0 .. 1 | Currently just a placeholder for the <configuration> element,
which in its turn is just a placeholder for the <threads> element. We expect that in the future, more system-level features can be configured under this element. |
<project> | 1 .. * | Defines a basic unit of work. |
<plugin> | 0 .. * | Registers a classname with an alias. |
<property> | 0 .. * | Defines a name/value pair used in configuration. |
<include.projects> | 0 .. * | Add projects defined in other configuration files. |
<threads>
<cruisecontrol> <system> <configuration> <threads>
The <threads>
element can be used to configure the number of threads that CruiseControl can use
simultaneously to build projects. This is done through the count
attribute.
If this element (or one of its parent elements) is not specified, this defaults to 1.
This means that only one project will be built at a time. Raise this number if your server has enough resources to
build multiple projects simultaneously (especially useful on multi-processor systems). If more projects than the maximum
number of threads are scheduled to run at a given moment, the extra projects will be queued.
Attributes
Attribute | Required | Description |
---|---|---|
count | Yes | Maximum number of threads to be in use simultaneously to build projects |
<property>
<cruisecontrol> <property>
The <property>
element is used to set a property (or set of properties)
within the CruiseControl configuration file. Properties may be set at the global level
and/or within the scope of a project. There are three ways to set properties within CruiseControl:
- By supplying both the name and value attributes.
- By setting the file attribute with the filename of the property file to load. This property file must follow the format defined by the class java.util.Properties, with the same rules about how non-ISO8859-1 characters must be escaped.
- By setting the environment attribute with a prefix to use. Properties will be defined for every environment variable by prefixing the supplied name and a period to the name of the variable.
Properties in CruiseControl are not entirely immutable: whoever sets a property last will freeze it's value within the scope in which the property was set. In other words, you may define a property at the global level, then eclipse this value within the scope of a single project by redefining the property within that project. You may not, however, set a property more than once within the same scope. If you do so, only the last assignment will be used.
Just as in Ant, the value part of a property being set may contain references to other properties. These references are resolved at the time these properties are set. This also holds for properties loaded from a property file, or from the environment.
Also note that the property ${project.name}
is set for you automatically and will always resolve
to the name of the project currently being serviced - even outside the scope of the project
definition.
Finally, note that properties bring their best when combined with plugin preconfigurations.
Attributes
Attribute | Required | Description |
---|---|---|
name | Exactly one of name, environment, or file. | The name of the property to set. |
environment | The prefix to use when retrieving environment variables. Thus if you specify environment="myenv" you will be able to access OS-specific environment variables via property names such as "myenv.PATH" or "myenv.MAVEN_HOME". | |
file | The filename of the property file to load. | |
value | Yes, if name was set. | The value of the property. This may contain any previously defined properties. |
toupper | No | Used in conjunction with environment. If set to true, all environment variable names will be converted to upper case. |
Examples
- Set a couple of global properties using name/value pairs:
<cruisecontrol> <property name="cruisedir" value="/home/cruise"/> <property name="logdir" value="${cruisedir}/logs"/> ... <cruisecontrol>
- Set a collection of global properties from the properties file "config.properties":
<cruisecontrol> <property file="config.properties"/> ... <cruisecontrol>
- Load the system's environment into a collection of global properties.
Uppercase all environment variable names:
<cruisecontrol> <property environment="env" toupper="true"/> <property name="logdir" value="${env.CCDIR}/logs"/> ... <cruisecontrol>
- Define a global property called "buildmanager". Override it's value
only within the scope of the project called "project2".
<cruisecontrol> <property name="buildmanager" value="[email protected]"/> <project name="project1"> <!-- ${buildmanager} resolves to "[email protected]" --> </project> <project name="project2"> <property name="buildmanager" value="[email protected]"/> <!-- ${buildmanager} resolves to "[email protected]" --> </project> <cruisecontrol>
- As demonstrated here, properties and
plugin pre-configuration
can be an extremely powerful combination.
<cruisecontrol> <!-- Load environment variables --> <property environment="env" toupper="true"/> <!-- Commonly used directories --> <property name="reportdir" value="${env.CCDIR}/report"/> <property name="projectdir" value="${env.CCDIR}/checkout/${project.name}"/> <property name="testdir" value="${projectdir}/build/junit-reports"/> <property name="logdir" value="${env.CCDIR}/logs/${project.name}"/> <!-- Defaults for email --> <property name="buildmaster.email" value="[email protected]"/> <property name="buildmaster.name" value="Buildmaster"/> <!-- Preconfigure our plugins --> <plugin name="log" dir="${logdir}"/> <plugin name="currentbuildstatuslistener" file="${logdir}/buildstatus.html"/> <plugin name="cvs" localworkingcopy="${projectdir}"/> <plugin name="ant" antscript="${env.ANT_HOME}/bin/ant" antWorkingDir="${projectdir}" target="cruise"/> <plugin name="htmlemail" buildresultsurl="http://servername/cruisecontrol/buildresults/${project.name}" mailhost="smtp.example.com" returnaddress="${buildmaster.email}" returnname="${buildmaster.name}" subjectprefix="[BUILD ${project.name}]" xsldir="${reportdir}/jsp/webcontent/xsl" css="${reportdir}/jsp/webcontent/css/cruisecontrol.css"/> <project name="project1"/> <listeners> <currentbuildstatuslistener/> </listeners> <log> <merge dir="${testdir}"> </log> <modificationset> <cvs/> </modificationset> <schedule> <ant/> </schedule> <publishers> <htmlemail> <always address="${buildmaster.email}"> <failure address="[email protected]"> <ignore address="buildmaster"> </htmlemail> </publishers> </project> <project name="project2"/> <listeners> <currentbuildstatuslistener/> </listeners> <log> <merge dir="${testdir}"> </log> <modificationset> <cvs/> </modificationset> <schedule> <ant/> </schedule> <publishers> <htmlemail> <always address="${buildmaster.email}"> <failure address="[email protected]"> </htmlemail> </publishers> </project> </cruisecontrol>
<include.projects>
<cruisecontrol> <include.projects>
The <include.projects> tag is used to consolidate several configuration files into a single configuration. One advantage over using XML includes are that the target files are valid configuration files in their own right and not just XML fragments. Also, including projects using the tag is less fragile as an error in one file will not keep the rest of the projects for building.
Configuration files included this way are processed with the properties and plugins defined in the main configuration file, which easily allows per instance configuration. Properties and plugins defined in the processed files are not made available outside the scope of that file.
Project names must still remain unique. The first project with a given name will be loaded and any subsequent projects attempting to use the same name will be skipped.
Changes to any of the included file with be detected and cause the configuration to be reload, just as if they had been made to the parent file.
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | Relative path from current configuration file to the configuration file to process. |
<project>
<cruisecontrol> <project>
A <project>
is the basic unit of work — it
will handle checking for modifications, building, and publishing the
results of your project.
Note: one config.xml file can contain several
<project>
elements; these projects will all run in
a shared build queue (see the <threads> element
if you want to build multiple projects at the same time).
Attributes
Attribute | Required | Description |
---|---|---|
name | Yes | Unique identifier for this project |
buildafterfailed | No (defaults to true) | Should CruiseControl keep on building even though it has failed and no new modifications are detected? This feature is useful if you want CruiseControl to detect situations where a build fails because of outside dependencies (like temporary failing database connection). |
requireModification | No (defaults to true) | Is a modification required for the build to continue?
Default value is true. Useful to set to false when the schedule
has only time based builds or if you want to run tests to verify
an external resource (such as a database). |
forceOnly | No (defaults to false) | Indicate that the build for the project only occurs when forced. Note that if the buildAfterFailed attribute is true, then builds will continue to occur based upon the the rules on <schedule> until the build is successful. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<listeners> | 0 .. 1 | Container element for Listener plugin instances. |
<bootstrappers> | 0 .. 1 | Container element for Bootstrapper plugin instances. |
<modificationset> | 1 | Container element for SourceControl plugin instances. |
<schedule> | 1 | Specifies the SourceControl poll interval, and is a parent element for Builder plugin instances. |
<log> | 0 .. 1 | Specifies where project log files are stored. |
<publishers> | 0 .. 1 | Container element for Publisher plugin instances. |
<dateformat> | 0 .. 1 | Overrides the default date format for presentation. |
<plugin> | 0 .. * | Registers a classname with an alias. |
<listeners>
<cruisecontrol> <project> <listeners>
The <listeners>
element is a container element
for Listener plugin instances.
Listeners are notified with every ProjectEvent but most Listeners are designed to handle a specific subclass of ProjectEvent.
Child Elements
Element | Cardinality | Description |
---|---|---|
<currentbuildstatusftplistener> | 0 .. * | Writes a build status snippet to the filesystem and to an FTP server |
<currentbuildstatuslistener> | 0 .. * | Writes a build status snippet to the filesystem |
<currentbuildstatuspagelistener> | 0 .. * | Writes build status to the filesystem using by replacing values in a template |
<cmsynergysessionmonitor> | 0 .. * | Monitors and starts CM Synergy sessions as needed |
<lockfilelistener> | 0 .. * | Responsible for deleting the lock file when a project goes IDLE |
<cmsynergysessionmonitor>
<cruisecontrol> <project> <listeners> <cmsynergysessionmonitor>
The <cmsynergysessionmonitor> listener will monitor and start CM Synergy sessions as needed. It is triggered with each build loop (before the bootstrappers are run) and can monitor any number of CM Synergy sessions. The <cmsynergysessionmonitor> also provides a mapping between a simple "nick-name" for a session (which is referred to as the "sessionname") and the full CM Synergy session ID. This map is persisted in a simple properties file (referred to as the "session file").
Each time the <cmsynergysessionmonitor> runs, it will load the persisted information from the session file and attempt to verify that each monitored session is, in fact, still running. It does this according to the following rules:
- If the session file does not exist, it will be created.
- If an entry for the session name does not exist in the session file, a new CM Synergy session will be started and an entry recorded in the file.
- If an entry for the session name does exist in the file, it will check that the CM Synergy session ID associated with the session name is still running. If it is, no further action is taken. If it is not, a new CM Synergy session is started, and the new ID recorded in the file.
Attributes
Attribute | Required | Description |
---|---|---|
ccmexe | No | The name of the CM Synergy command line client. If not provided, the plugin will search the system path for an executable called "ccm" (or "ccm.exe" for Windows). |
sessionfile | No | The session file used to persist the CM Synergy session information. If not provided, it defaults to a file called ".ccmsessionmap" located in your home directory. |
Child Elements
Element | Cardinality | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<session> | 1 .. * | Defines a CM Synergy session you wish to monitor. The session information may be provided in one of two ways.
|
Examples
- Monitor two sessions. The first will be associated with the database
/ccmdb/product1, the second will use the database /ccmdb/product2.
We will specify all attributes in the config file for the first
session, and use an attribute file called "session2.properties" for
the second. We will accept the default session file location of
".ccmsessionmap" in our home directory. Both sessions will run on
the local host machine.
<listeners> <cmsynergysessionmonitor> <session name="session1" database="/ccmdb/product1" user="buildmgr" role="build_mgr" password="P@ssW0rd!"/> <session name="session2" attributefile="session2.properties"/> <cmsynergysessionmonitor/> <listeners/>
Session 2 would then use a properties file as follows:#CM Synergy session properties for "session2" database=/ccmdb/product2 user=buildmgr role=build_mgr password=P@ssW0rd!
<currentbuildstatuslistener>
<cruisecontrol> <project> <listeners> <currentbuildstatuslistener>
The CruiseControl Build Results JSP can indicate whether or not
CruiseControl is currently building a project. To get this information
to the JSP, we can use the optional
<currentbuildstatuslistener>
to write an HTML
snippet to disk in a location where the JSP can read it. This file will
consist of the current status of the build and the last time the status
changed, with the formatting set by the
dateformat element.
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | The filename to write, including path |
<currentbuildstatuspagelistener>
<cruisecontrol> <project> <listeners> <currentbuildstatuspagelistener>
Updates replaceable text in a pattern file each time the Project status changes. Can show full project status history. The following items will be replaced with their values each time they occur in the source file:
- {Project} - Project Name.
- {State.Name} - Name of current project state.
- {State.Description} - Description of current project state.
- {State.Date} - Date/time the current state happened
- {State.Duration} - How long since this state was in effect. (Only useful in {History} line.)
- {History} - Historical states. Must be first on line. This line will be processed and output once for each state the project has previously been in. The {History} tag will be deleted from the line.
A default template is provided of the form "{Project}: {State.Date} - {State.Name}: {State.Description}"
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | The filename to write, including path |
sourceFile | No | The file with the template to use for subtitution |
<currentbuildstatusftplistener>
<cruisecontrol> <project> <listeners> <currentbuildstatusftplistener>
This plugin is mostly identical to the
<currentbuildstatuslistener>
, to which it adds sending the HTML
snippet to a remote FTP server.
Attributes
Attribute | Required | Description |
---|---|---|
filename | Yes | The filename to write, including path |
destdir | Yes | The remote directory in which the file will be sent to. |
<lockfilelistener>
<cruisecontrol> <project> <listeners> <lockfilelistener>
This plugin works in conjunction with a <lockfilebootstrapper>
to define a set of projects that will not build simultaneously in a multithreaded build environment. This plugin is responsible for deleting the lock file when a project goes IDLE (but only if the lock was created by the same project.
Attributes
Attribute | Required | Description |
---|---|---|
lockfile | Yes | The name (and path) of the file to serve as the lock between multiple projects. |
projectname | Yes | Lockfile only deleted when contents match the value set for project name. |
<bootstrappers>
<cruisecontrol> <project> <bootstrappers>
The <bootstrappers>
element is a container element
for Bootstrapper plugin instances.
Bootstrappers are run before a build takes place, regardless of whether a build is necessary or not, but not if the build is paused. Each bootstrapper element is independent of the others so it is quite possible to have multiple bootstrappers of the same time, say 3 CVS or VssBootstrappers to update 3 different files.
Child Elements
Element | Cardinality | Description |
---|---|---|
<accurevbootstrapper> | 0 .. * | Updates the resources of an Accurev workspace |
<alienbrainbootstrapper> | 0 .. * | Bootstraps resources from AlienBrain |
<antbootstrapper> | 0 .. * | Executes an Ant script which implements a custom bootstrapper |
<clearcasebootstrapper> | 0 .. * | Bootstraps resources from ClearCase |
<clearcaseviewstrapper> | 0 .. * | Bootstraps View and VOB resources from ClearCase |
<cmsynergybootstrapper> | 0 .. * | Bootstraps resources from CM Synergy |
<currentbuildstatusbootstrapper> | 0 .. * | Writes a build status snippet to the filesystem |
<currentbuildstatusftpbootstrapper> | 0 .. * | Transfers a build status snippet via FTP |
<cvsbootstrapper> | 0 .. * | Bootstraps resources from CVS |
<execbootstrapper> | 0 .. * | Execute a command for bootstrapping |
<lockfilebootstrapper> | 0 .. * | Creates the lock file if it doesn't already exist |
<p4bootstrapper> | 0 .. * | Bootstraps resources from Perforce |
<plasticscmbootstrapper> | 0 .. * | Bootstraps resources from Plastic SCM |
<snapshotcmbootstrapper> | 0 .. * | Bootstraps resources from SnapshotCM |
<starteambootstrapper> | 0 .. * | Bootstraps resources from Star Team |
<surroundbootstrapper> | 0 .. * | Bootstraps resources from Surround SCM |
<svnbootstrapper> | 0 .. * | Bootstraps resources from Subversion |
<vssbootstrapper> | 0 .. * | Bootstraps resources from Visual Source Safe |
<accurevbootstrapper>
<cruisecontrol> <project> <bootstrappers> <accurevbootstrapper>
Automatically updates an accurev workspace. The selected workspace must already exist on the local filesystem.
Attributes
Attribute | Required | Description |
---|---|---|
keep | No (defaults to "false") | If true, the plugin runs "accurev keep -m" before trying to update the workspace, to keep all modified elements. |
synctime | No (defaults to "false") | If true, the plugin runs "accurev synctime" before trying to update the workspace, to synchronize the local clock with the Accurev server's. |
verbose | No (defaults to "false") | Enables detailed logging. |
workspace | No (defaults to the current dir) | The local path containing the working copy of the desired workspace. |
Examples
- Updates the workspace locally stored on
D:\accurev\workspace_user\MyProject
, after synchronizing the local clock with the autokeeping all the modified files.<bootstrappers> <accurevbootstrapper workspace="D:\accurev\workspace_user\MyProject" synctime="true" keep="true" verbose="true"/> <bootstrappers>
<alienbrainbootstrapper>
<cruisecontrol> <project> <bootstrappers> <alienbrainbootstrapper>
Syncs a single path from AlienBrain before the build begins. Useful if you want to leave all SCM up to CruiseControl. Allowing the bootstrapper to update the project makes for a simpler build.xml but allows a window where a file can be committed after the update and before the modification check.
Attributes
Attribute | Required | Description |
---|---|---|
server | No | The name of the machine hosting the AlienBrain repository. If specified, it will override the value in the NXN_AB_SERVER environment variable. |
database | No | The name of the project in the AlienBrain repository. If specified, it will override the value in the NXN_AB_DATABASE environment variable. |
user | No | The AlienBrain user account name to use when querying for modifications. If specified, it will override the value in the NXN_AB_USERNAME environment variable. |
password | No | The password of the AlienBrain user account to use when querying for modifications. If specified, it will override the value in the NXN_AB_PASSWORD environment variable. |
path | Yes | The path to the item that will be retrieved from AlienBrain. Typically a path like 'alienbrain://Project/SubProject/build.xml' If the path is a file, that file will be retrieved. If the path is a directory, the directory will be retrieved recursively. |
branch | No | The branch of the project from which to retrieve the path. |
forcefileupdate | No (defaults to false) | If set to true, the local file is always updated with the file on the server. This is not the same as overwritewritable="replace". It means that the file will be retrieved even if it has not been modified in the repository. |
overwritewritable | No (defaults to 'skip') | Must be either 'skip' or 'replace'. 'ask' is not an option as no one is around to answer the question.
|
localpath | No | If localpath is specified the item is copied to the specified local path. |
<antbootstrapper>
<cruisecontrol> <project> <bootstrappers> <antbootstrapper>
Executes an Ant script which implements a custom bootstrapper.
Attributes
The antbootstrapper uses the same attributes as the <ant> builder.Child Elements
The antbootstrapper supports the same set of child elements as the <ant> builder.Examples
- Invoke the ant.bat script distributed with ant, specifying the
working directory as
D:\workspace\MyProject
and the ant build file asMyProject-nightlybuild.xml
and the ant target asbootstrap
.<bootstrappers> <antbootstrapper antscript="C:\Java\apache-ant-1.6.1\bin\ant.bat" antworkingdir="D:\workspace\MyProject" buildfile="MyProject-nightlybuild.xml" uselogger="true" usedebug="false" target="bootstrap"/> <bootstrappers>
<clearcasebootstrapper>
<cruisecontrol> <project> <bootstrappers> <clearcasebootstrapper>
Can be used to pull a single file (usually build.xml and/or build.properties) from ClearCase prior to building.
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | The filename to write |
viewPath | No | local path to the file |
<clearcaseviewstrapper>
<cruisecontrol> <project> <bootstrappers> <clearcaseviewstrapper>
Can be used to automate the start-up of ClearCase Views and VOBs prior to building in dynamic views.
Attributes
Attribute | Required | Description |
---|---|---|
viewpath | Yes | A path into the dynamic view to start-up, i.e. M:\someview\somevob\somepath (Windows) or /view/someview/vobs/somevob/somepath (Linux/Unix). A path is specified rather than a view tag so that you can re-use a CruiseControl property definition. |
voblist | No | A comma separated list of VOBs to mount, i.e. "\VOB1,\VOB2" (Windows) or "/vobs/VOB1,/vobs/VOB2" (Linux/Unix). |
Examples
- Start the Windows view "j2ee_bld" and mount the VOBs "\J2EE_Sources" and "\J2EE_Binaries":
<property name="dir.j2ee" value="M:\j2ee_bld\J2EE_Sources\src"/> <bootstrappers> <clearcaseviewstrapper viewpath="${dir.j2ee}" voblist="\J2EE_Sources,\J2EE_Binaries"/> <bootstrappers>
<cmsynergybootstrapper>
<cruisecontrol> <project> <bootstrappers> <cmsynergybootstrapper>
Used to reconfigure a CM Synergy project or project hierarchy
Attributes
Attribute | Required | Description |
---|---|---|
ccmexe | No | The name of the CM Synergy command line client. If not provided, the plugin will search the system path for an executable called "ccm" (or "ccm.exe" for Windows). |
sessionfile | No | The session file used by the <cmsynergysessionmonitor> to persist your CM Synergy session information. If this attribute is not set, it defaults to the file ".ccmsessionmap" in your home directory. |
sessionname | No | The session name of the CM Synergy session you wish to use. This name must appear in the session file. If not set, the plugin will attempt to use the default (current) session as returned by the "ccm status" command. |
project | Yes | The project spec (two part name) of the project you wish to reconfigure. |
recurse | No | If set to true, all subprojects will also be reconfigured. Defaults to true |
Examples
- Reconfigure the "j2ee~1.0_int" project (but not it's subprojects) using
the CM Synergy session named "j2ee_session".
<bootstrappers> <cmsynergybootstrapper project="j2ee~1.0_int" sessionname="j2ee_session" recurse="false"/> <bootstrappers>
<currentbuildstatusbootstrapper>
<cruisecontrol> <project> <bootstrappers> <currentbuildstatusbootstrapper>
Note: this plugin has been made obsolete by the
currentbuildstatuslistener
.
The CruiseControl Build Results JSP can indicate whether or not
CruiseControl is currently building a project. To get this information
to the JSP, we can use the optional
<currentbuildstatusbootstrapper>
to write an HTML
snippet to disk in a location where the JSP can read it. This file will
consist of the time the build was started with the formatting set by the
dateformat element.
This plugin is used in tandem with the
currentbuildstatuspublisher
.
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | The filename to write, including path |
<currentbuildstatusftpbootstrapper>
<cruisecontrol> <project> <bootstrappers> <currentbuildstatusftpbootstrapper>
Note: this plugin has been made obsolete by the
currentbuildstatusftplistener
.
This performs the same action as <currentbuildstatusbootstrapper>
,
except that the status file is sent to the remote site via FTP, instead
of being stored locally.
Attributes
In addition to the common FTP attributes,
<currentbuildstatusbootstrapper>
uses the following
attributes.
Attribute | Required | Description |
---|---|---|
file | Yes | The filename to write. |
destDir | Yes | The remote directory (relative to targetDir )
to write the file. |
<cvsbootstrapper>
<cruisecontrol> <project> <bootstrappers> <cvsbootstrapper>
Since there can be a reliance on the build.xml to handle updating
the source code, there has always been a problem with what happens when
the build.xml file itself changes. <cvsbootstrapper>
can solve this problem either by pulling a single file (such as
build.xml) or by updating the entire project. Allowing the bootstrapper
to update the project makes for a simpler build.xml but allows a window
where a file can be committed after the update and before the
modification check.
Attributes
<cvsbootstrapper>
requires at least one of its
attributes to be set.
Attribute | Required | Description |
---|---|---|
localWorkingCopy | No | Path (absolute or relative to Build Loop execution directory) to the local copy of the CVS module which contains the target file. CVSBootstrapper will execute the update command from this directory if specified. Defaults to Build Loop execution directory. |
cvsroot | No | The CVSROOT. Not required if the current working directory is in the cvs project or if the localWorkingCopy attribute is set. |
file | No | The file to update from CVS, relative to localworkingcopy. If not specified either the current working directory must be in the local cvs project or the localWorkingCopy must be set. |
overwriteChanges | No | If set to true the update command will include the -C option which will overwrite local changes. |
resetStickyTags | No | If set to true the update command will include the -A option which will reset any sticky tags, dates, or -k options. |
<execbootstrapper>
<cruisecontrol> <project> <bootstrappers> <execbootstrapper>
This bootstrapper executes a command. As it is based on the ExecBuilder, it has the same attributes
<lockfilebootstrapper>
<cruisecontrol> <project> <bootstrappers> <lockfilebootstrapper>
This plugin works in conjunction with a <lockfilelistener>
to define a set of projects that will not build simultaneously in a multithreaded build environment. This plugin is responsible for creating the lock file if it doesn't already exist, or if it does, to throw an exception to abort the build attempt. When a build attempt is aborted the project will not be retried until the next build time as determined by the schedule interval or the schedule build time.
Attributes
Attribute | Required | Description |
---|---|---|
lockfile | Yes | The name (and path) of the file to serve as the lock between multiple projects. |
projectname | Yes | The project name is written to the lockfile so that the LockFileListener knows which to delete. |
<p4bootstrapper>
<cruisecontrol> <project> <bootstrappers> <p4bootstrapper>
Syncs a single path from Perforce before the build begins. Useful if you want to leave all SCM up to CruiseControl. Allowing the bootstrapper to update the project makes for a simpler build.xml but allows a window where a file can be committed after the update and before the modification check.
Setting the path to a complete P4 depot ending with a typical
triple dot (...) will synch all the files, e.g. //depot/myproject/...
Note that the attributes path, p4Port, p4User, and p4Client are deprecated. Please use the attributes listed below.
Attributes
Attribute | Required | Description |
---|---|---|
view | Yes | Valid Perforce path (a.k.a. 'view') |
port | No | Perforce Server connection to use (host:port) |
user | No | Perforce User name to use |
passwd | No | Perforce password to use |
client | No | Perforce Client name to use |
<plasticscmbootstrapper>
<cruisecontrol> <project> <bootstrappers> <plasticscmbootstrapper>
Automatically updates the workspace before the build begins. The selected workspace must already exist on the local filesystem.
Attributes
Attribute | Required | Description |
---|---|---|
wkspath | Yes | Valid Plastic SCM workspace path. |
branch | No | The branch from which to get the source. If none has been specified, it updates the workspace according to its configuration. |
repository | No | The repository from which to get the source. If none has been specified, it updates the workspace according to its configuration. |
pathtoupdate | No | A path under the workspace path which will be updated. If none is specied, it updates all the workspace. |
forced | No (defaults to "false") | Do the update with the "--forced" option |
Examples
- Update the workspace (using the option forced) in the path in c:\work\cruise\plasticwks setting the branch "br:/main" as working branch.
<bootstrappers> <plasticscmbootstrapper wkspath="c:\work\cruise\plasticwks" branch="br:/main" forced="yes" /> <bootstrappers>
<snapshotcmbootstrapper>
<cruisecontrol> <project> <bootstrappers> <snapshotcmbootstrapper>
Can be used to pull a single file (usually build.xml and/or build.properties) or directory from SnapshotCM prior to building.
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | Name of the file or directory to fetch from the SnapshotCM repository. Updates from SnapshotCM repository will be recursive and forced (over-writing any local changes). |
<starteambootstrapper>
<cruisecontrol> <project> <bootstrappers> <starteambootstrapper>
Handles updating multiple files (space separated list) from StarTeam before the build begins.
Attributes
Attribute | Required | Description |
---|---|---|
files | Yes | Space separated list of files to retrieve |
folder | Yes | The repository folder |
localfolder | No | Path to the folder on the local file system |
password | Yes | |
port | Yes | Port StarTeam server is using |
project | Yes | StarTeam project |
server | Yes | Hostname for StarTeam server |
username | Yes | |
view | Yes | StarTeam view |
<surroundbootstrapper>
<cruisecontrol> <project> <bootstrappers> <surroundbootstrapper>
Fetches a single repository (and optionally it's sub-repositories) from Surround SCM before starting the build.
Attributes
Attribute | Required | Description |
---|---|---|
branch | No | Surround SCM branch name. The default is pulled from the local working directory. |
repository | No | Surround SCM repository path. The default is pulled from the local working directory. |
label | No | Enter a label to search for when getting files. |
includeremovedfiles | No | Include removed files when getting files by label or timestamp. Default is true. Ignored if a label is not specified. Options are 1 or 0 (default). |
overwrite | No | Enter how to handle a local writable file. Options are 1 to overwrite or 0 (default) to skip. |
recursive | No | Recursively get files and sub-repositories. Options are 1 or 0 (default). |
forcefetch | No | Force file retrieval from server regardless of the local copy status. Options are 1 or 0 (default). |
makewritable | No | Make local file editable or writable. Default is read-only. Options are 1 or 0 (default). |
serverconnect | No | Enter the address and port number of the Surround SCM server host computer. Format is server:port. If not entered, the last saved connection parameters are used. |
serverlogin | No | Enter the username and password used to login to the Surround SCM server. Format is username:password. If not entered, the last saved login parameters are used. |
<svnbootstrapper>
<cruisecontrol> <project> <bootstrappers> <svnbootstrapper>
Handles updating a single file (typically build.xml and/or build.properties) from a Subversion repository before the build begins.
Attributes
Attribute | Required | Description |
---|---|---|
localWorkingCopy | One of these | the relative or absolute path to the local working copy of the Subversion repository on which to execute the update command. |
file | file to update from the Subversion repository. | |
username | No | used for authentication. |
password | No | used for authentication. |
checkExternals | No | whether any subversion externals this project uses should also be checked for modifications. |
<vssbootstrapper>
<cruisecontrol> <project> <bootstrappers> <vssbootstrapper>
Handles updating a single file (typically build.xml and/or build.properties) from VSS before the build begins.
Attributes
Attribute | Required | Description |
---|---|---|
vsspath | Yes | Fully qualified VSS path to the target file. If the leading
dollar-sign ['$'] is omitted, one will be prepended
automatically. Example: /Project/subproject/filename.ext |
localdirectory | Yes | Fully qualified path for the destination directory. Example: c:\directory\subdirectory\ |
login | No | VSS login information in the form username,password |
ssdir | No | Path to the directory containing ss.exe. By default, ss.exe
is assumed to be in the path. Note: should not contain whitespace. |
serverpath | No | Path to the directory containing srcsafe.ini. |
<modificationset>
<cruisecontrol> <project> <modificationset>
A container element for a set of modifications collected from all
included SourceControl elements. <modificationset>
can contain multiple elements which can be useful to check only parts
of a large project rather than checking all files every time.
Most SourceControl elements support the property
/propertyOnDelete
attributes which can allow for
conditional building that may greatly speed the feedback cycle.
Attributes
Attribute | Required | Description |
---|---|---|
requiremodification | No (defaults to true) | Is a modification required for the build to continue?
Default value is true. Useful to set to false when the schedule
has only time based builds or if you want to run tests to verify
an external resource (such as a database). NOTE - This attribute
will be going away. Use the requireModification attribute that is on the
project tag instead. |
quietperiod | No (defaults to 60) | The number of seconds required to have passed since the last modification before a build can commence. This attribute is used to avoid starting a build while someone is in mid-checkin. If a modification is detected to be within the quiet period then CC will sleep until the quiet period is finished and then recheck for modifications. Small values recommended if you use a bootstrapper to sync files (as opposed to getting updates as part of the build). 0 is a valid value and recommended for version control systems such as Perforce and Subversion with atomic commits. |
ignoreFiles | No | Specify a comma separated list of glob-patterns identify files to be ignored in modificationsets.
Each pattern is matched against the complete path.
Example: *.txt,*/build/build.xml This is useful if you want to update and commit files during your CC build. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<accurev> | 0 .. * | Checks for changes in an AccuRev stream. |
<alienbrain> | 0 .. * | Checks for changes in an AlienBrain repository. |
<alwaysbuild> | 0 .. * | Always returns a single modification so the build will be run. |
<buildstatus> | 0 .. * | Checks for a successful build in another project. |
<clearcase> | 0 .. * | Checks for changes in a ClearCase repository. |
<cmsynergy> | 0 .. * | Checks for changes in a CM Synergy repository. |
<compound> | 0 .. * | Checks for changes from a list of trigger source controls, and if modification are detected, returns changes from a list of target source controls. |
<cvs> | 0 .. * | Checks for changes in a CVS repository. |
<filesystem> | 0 .. * | Checks for changes in a file system. |
<forceonly> | 0 .. * | Never returns any changes; use this to define a project that only builds when forced to. |
<harvest> | 0 .. * | Checks for changes in an All Fusion Harvest CM511 repository. |
<httpfile> | 0 .. * | Checks for changes in a remote file via http. |
<mks> | 0 .. * | Checks for changes in a MKS repository. |
<p4> | 0 .. * | Checks for changes in a Perforce repository. |
<plasticscm> | 0 .. * | Checks for changes in a Plastic SCM branch. |
<pvcs> | 0 .. * | Checks for changes in a PVCS repository. |
<snapshotcm> | 0 .. * | Checks for changes in a SnapshotCM repository. |
<starteam> | 0 .. * | Checks for changes in a Star Team repository. |
<surround> | 0 .. * | Checks for changes in a Surround SCM repository. |
<svn> | 0 .. * | Checks for changes in a Subversion repository. |
<timebuild> | 0 .. * | Triggers a build after a particular time threshold. |
<veto> | 0 .. * | Checks for changes in another project and will veto a build if changes are found. |
<vss> | 0 .. * | Checks for changes in a Visual SourceSafe repository. |
<vssjournal> | 0 .. * | Checks for changes in a Visual SourceSafe, Journal File Implementation. |
<accurev>
<cruisecontrol> <project> <modificationset> <accurev>
Checks for modifications in an AccuRev stream.
Attributes
Attribute | Required | Description |
---|---|---|
stream | Yes | The name of the AccuRev stream where the plugin looks for Modification(s). |
verbose | No (defaults to "false") | Set to "true" to enable a more verbose logging style. |
property | No | Will set this property if a modification has occurred. For use in conditionally controlling the build later. |
<alienbrain>
<cruisecontrol> <project> <modificationset> <alienbrain>
Triggers a build if there is a change in an AlienBrain repository.
Changes are detected by running a command similar to the following:
ab find PathToProject -regex "SCIT > lastbuildtime"
Attributes
Attribute | Required | Description |
---|---|---|
server | No | The name of the machine hosting the AlienBrain repository. If specified, it will override the value in the NXN_AB_SERVER environment variable. |
database | No | The name of the project in the AlienBrain repository. If specified, it will override the value in the NXN_AB_DATABASE environment variable. |
user | No | The AlienBrain user account name to use when querying for modifications. If specified, it will override the value in the NXN_AB_USERNAME environment variable. |
password | No | The password of the AlienBrain user account to use when querying for modifications. If specified, it will override the value in the NXN_AB_PASSWORD environment variable. |
path | Yes | The path to the item that will be queried for modifications Typically a path like 'alienbrain://Project/SubProject' |
branch | No | The branch of the project to check for modifications. |
property | No | Will set this property if a modification has occurred. For use in conditionally controlling the build later. |
<alwaysbuild>
<cruisecontrol> <project> <modificationset> <alwaysbuild>
Used to always trigger a build by returning a single modification.
Attributes
Attribute | Required | Description |
---|---|---|
username | No (defaults to "User") | The username to use for the single reported (fake) Modification. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<buildstatus>
<cruisecontrol> <project> <modificationset> <buildstatus>
Used to trigger a build when another CruiseControl project has a successful build. When triggered, this will report a modification with action "add", the successfully built project's logfile, the name of the successfully built project's log directory (the final component of attribute logdir), and the username set to "cc-" + name of the successfully built project. You may need make an alias for this username if you are using an <email> publisher.
Attributes
Attribute | Required | Description |
---|---|---|
logdir | Yes | Path to CruiseControl log directory for the project to monitor. |
property | No | Will set this property if a modification has occurred. For use in conditionally controlling the build later. |
Properties Passed to the Builders
In addition to the standard CruiseControl properties passed to builders, <buildstatus> sets the following properties:
Property Name | Description |
---|---|
most.recent.logdir | The location being checked for new log files |
most.recent.logfile | The name of the newest logfile included in the modification set |
most.recent.logtime | The timestamp of the newest build included in the
modification set, using the format
yyyyMMddHHmmss |
most.recent.loglabel | The label of the newest build included in the modification set |
<clearcase>
<cruisecontrol> <project> <modificationset> <clearcase>
Triggers a build if there is a change within a ClearCase repository.
Attributes
Attribute | Required | Description |
---|---|---|
branch | Yes | The ClearCase branch |
recursive | No (defaults to true) | Whether to check sub-folders in the viewpath. |
all | No (defaults to false) | Set when checking the entire view path.
When checking the entire view path this option invokes 'lshistory -all'
instead of 'lshistory -recursive', which is much faster. This option is mutually exclusive with the recursive property. Note that 'all' does not use your view's config-spec rules. It behaves like having a single line config-spec that selects just ELEMENT * /<branch>/LATEST (i.e. 'lshistory -all' results that contain @@ are discarded). This differs from 'recurse', which only shows items selected by your current view. |
viewpath | Yes | Local working copy to use when making queries |
property | No | Will set this property if a modification has occurred. For use in conditionally controlling the build later. |
Properties Passed to the Builders
In addition to the standard CruiseControl properties passed to builders, <clearcase> sets the following properties:
Property Name | Description |
---|---|
clearcaselastbuild | Timestamp representing the last built time, using the
format dd-MMMM-yyyy.HH:mm:ss |
clearcasenow | Timestamp representing the time the current build
started, using the format dd-MMMM-yyyy.HH:mm:ss |
<cmsynergy>
<cruisecontrol> <project> <modificationset> <cmsynergy>
Triggers a build if tasks have been added to any folder within a CM Synergy project's reconfigure properties since the last build.
Attributes
Attribute | Required | Description |
---|---|---|
ccmexe | No | The name of the CM Synergy command line client. If not provided, the plugin will search the system path for an executable called "ccm" (or "ccm.exe" for Windows). |
sessionfile | No | The session file used by the <cmsynergysessionmonitor> to persist your CM Synergy session information. If this attribute is not set, it defaults to the file ".ccmsessionmap" in your home directory. |
sessionname | No | The session name of the CM Synergy session you wish to use. This name must appear in the session file. If not set, the plugin will attempt to use the default (current) session as returned by the "ccm status" command. |
project | Yes | The project spec (two part name) of the CM Synergy project in which you wish to search for changes. |
instance | No | Used to set the project's instance value. As CM Synergy only allows a single instance of a project object in any given database, this attribute defaults to "1", and should not need to be changed by most users. You might, however, need to set this value when using the DCM (Distributed Change Management) feature of the tool - which appends the DB name to the instance value. |
ccmdateformat | No | The default (output) date format used by CM Synergy is "EEE MMM dd HH:mm:ss yyyy" If you have customized this for your installation, you must provide the correct format here. The format should follow the standard defined in Java's SimpleDateFormat class. |
updatefolders | No | By default, the plugin will always refresh the reconfigure properties of the given project before searching for changes. This allows any query based folders to update themselves with new tasks. If you wish to disable this feature (not recommended), you may set this attribute to false. This feature will only work with CM Synergy version 6.3 and above. If you are using an older version, you must set this option to false. In this case, you'll want to use the <cmsynergybootstrapper> as a workaround. Please see example 2 below as well as the Wiki site for more information. |
reconfigure | No | Disabled by default. If you set this option to true, the project (and optionally any subprojects) will be automatically reconfigured when changes are detected. This eliminates the need to handle this from within your build scripts. |
recurse | No | Used in conjunction with the reconfigure option. If set to true (which is the default) all subprojects will also be reconfigured. |
ignoreworkarea | No | By default, the plugin will query CM Synergy to determine the work area location of the project. This location is then passed to the builders in the property "cc.ccm.workarea". If you wish to disable this feature (not recommended), you can set this attribute to true. |
changesynergyurl | No | If provided, an active link will be created from the build results web page to any change requests associated with any new tasks. The format should be "http://server:port". If you wish to use this option, you must also set the ccmdb attribute. |
ccmdb | No | Used in conjunction with changesynergyurl. This should be set to the location of the database on the CM Synergy server. (e.g. "/ccmdb/mydb") |
language | No | If you have a non U.S. English installation of CM Synergy, you may specify the ISO language code here. (e.g. fr, de, etc.) |
country | No | If you have a non U.S. English installation of CM Synergy, you may specify the ISO country code here. (e.g. FR, DE, etc.) |
property | No | Added for compliance with the CruiseControl API. A property of this name will be provided to the builders if any CM Synergy object has changed since the last build. The default is cc.ccm.haschanged, and probably shouldn't be altered. |
Properties Passed to the Builders
In addition to the standard CruiseControl properties passed to builders, <cmsynergy> sets the following properties:
Property Name | Description |
---|---|
cc.ccm.session | The CM Synergy session ID used to check for modifications. |
cc.ccm.dateformat | The date format used to convert CM Synergy dates into Java dates. |
cc.ccm.project | The two part name of the project (as provided in the project attribute). |
cc.ccm.workarea | The file system location of the CM Synergy work area for the project (unless the ignoreworkarea attribute was set). |
cc.ccm.haschanged (or the value specified by the property attribute) | Set to true if any CM Synergy objects have changed since the last build. |
Examples
- Use the session named "j2ee_session" to check for changes within the
"j2ee~1.0_int" project. If any changes are detected, reconfigure the
project and all of it's subprojects.
<modificationset> <cmsynergy project="j2ee~1.0_int" sessionname="j2ee_session" reconfigure="true"/> <modificationset/>
- For users of CM Synergy older than version 6.3 only. Use the
<cmsynergybootstrapper>
to reconfigure only the top level "j2ee~1.0_int" project. This will
update the folders within that project's reconfigure properties.
We can then check for changes just as we did in the first example.
Notice that we must set the "updatefolder" attribute to false.
<bootstrappers> <cmsynergybootstrapper project="j2ee~1.0_int" sessionname="j2ee_session" recurse="false"/> <bootstrappers> <modificationset> <cmsynergy project="j2ee~1.0_int" updatefolders="false" sessionname="j2ee_session" reconfigure="true"/> <modificationset/>
<compound>
<cruisecontrol> <project> <modificationset> <compound>
Contains two separate lists of source controls:
<triggers>
and <targets>
. Triggers
are checked for modifications every scheduled poll. Targets are
only checked for modifications if there was any modifications detected
in the triggers.
Arbitrary nesting of source controls under <triggers>
and <targets>
is possible.
The <compound>
element allows optimized access to
source repositories, avoiding a full scan of the repository every
scheduled interval. A typical usage scenario is to configure the source
repository to update a single file after a commit, meaning that only a
single file need be checked in the triggers section.
In addition to the modifications returned by the target source controls all of their properties are returned as well. If includeTriggerChanges is set then the properties returned by the triggers are returned as well.
Attributes
Attribute | Required | Description |
---|---|---|
includeTriggerChanges | No (defaults to false) | Add the trigger modifications to the list of returned
modifications? By default, the list of returned modifications
only includes the source controls from the
<targets> element. By setting this attribute
to true, the list of modifications will include both
<triggers> and <targets>
modifications. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<triggers> |
1 | A container for one or more source control elements that
trigger a full check of the targets. Any child element of
<modificationset>
can be used as a child element of <triggers> . |
<targets> |
1 | A container for one or more source control elements that
collectively represent the modificationset of the
<compound> element. Any child element of
<modificationset>
can be used as a child element of <targets> . |
Example
This example polls the file mod_file.txt
every
scheduled interval using
<filesystem>
. When a change
is detected, <cvs>
is used to
determine the full list of modifications. If mod_file.txt
is never modified, cvs is never accessed.
<modificationset quietperiod="1" > <compound includeTriggerChanges="false"> <triggers> <filesystem folder="./mod_file.txt" /> </triggers> <targets> <cvs cvsroot=":pserver:user@cvs_repo.com:/cvs" /> </targets> </compound> </modificationset>
<cvs>
Triggers a build if there is a change within a CVS repository.
Changes are detected by running a command similar to the following:
cvs [-d CVSROOT] -q log|rlog [-N] -d "lastbuildtime<checktime" [-b|-rTAG] module
The following changes are made to generate the actual command:
log
is used when the localworkingcopy attribute is set,rlog
otherwise.lastbuildtime
is replaced with the date of the last build, using the date formatyyyy-MM-dd HH:mm:ss 'GMT'
.checktime
is replaced with the date at which the check takes place.- The
-d
option is only used when the cvsroot attribute is specified;CVSROOT
is replaced by the value of that attribute. - The
-r
option is only used when the tag attribute is specified;TAG
is replaced by the value of that attribute. Otherwise, the-b
option is used. - The
-N
option is only used when the tag attribute is not specified or if it is set toHEAD
. module
is replaced with the specified module name. If a local working copy is used then the module name is left off.
Refer to the cvs log reference for
further details of the cvs log
command.
A notable feature of the CVS element is that it will look for the file CVSROOT/users and, if the files exists, use the information in that file to map cvs usernames to email addresses. More details are on the CVSROOT/users page of the CruiseControl Wiki.
Attributes
Attribute | Required | Description |
---|---|---|
localworkingcopy | Either localworkingcopy or both cvsroot and module. | Relative or absolute path to the local working copy. Directory must exist and should have files from a previous checkout. |
cvsroot | Specifies the location of the CVS repository. This should
be of the form:pserver:[email protected]:/cvsroot/reponame
|
|
module | The name of the CVS module that should be used.
This is passed as the last parameter to the cvs rlog command.
Refer to the rlog command in the
cvs log reference for further details. |
|
tag | No (defaults to HEAD ) |
Specify the cvs tag. The value of this attribute is passed
directly to cvs log using the -r
option. Numeric revision numbers, tags, branch tags, or ranges of
revisions are valid (when a non branch tag is used, a single modification
per file will be listed). Refer to the -r option in the
cvs log reference for further details. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
propertyondelete | No | Set this property if a file has been deleted. For use in conditionally controlling the build later. |
reallyQuiet | No | Sets whether to use "-Q", instead of the default "-q" for the cvs log command. Setting this attribute to true can help to reduce CruiseControl log file size, especially when using branches. Defaults to false. |
<filesystem>
<cruisecontrol> <project> <modificationset> <filesystem>
Returns all files beneath the specified folder than have been modified since the last build time. Any modified files are reported as modifications of type "changed" by user "User". Can also have folder be just a single file. Only looks at timestamp, not for actual changes to the file.
Attributes
Attribute | Required | Description |
---|---|---|
folder | Yes | Root folder of the directories to scan, or path to file to check for modifications. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
username | No (defaults to "User") | The username to use for the reported Modifications. |
<forceonly>
<cruisecontrol> <project> <modificationset> <forceonly>
Never returns any changes. Use this to define a project that only builds when forced to, like for release builds. If you also want the modifications between two forced builds to be reported, you'll have to use another solution (for instance, define a <compound> with a <filesystem> in the <triggers> and touch the specified file to force a build).
Attributes
Attribute | Required | Description |
---|---|---|
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<harvest>
<cruisecontrol> <project> <modificationset> <harvest>
Checks a AllFusion Harvest CM 5.1.1 repository for changes.
Attributes
Attribute | Required | Description |
---|---|---|
userName | Yes | user name used for authentication to the AllFusion Harvest server. |
password | Yes | password used for authentication to the AllFusion Harvest server. |
brokerName | Yes | name of the AllFusion Harvest server. |
projectName | Yes | name of the project/repository under source control within the AllFusion Harvest server. |
repositoryName | No | name of the project/repository under source control within the
AllFusion Harvest server. Note:This parameter can be used in place of the projectName parameter. |
timeAdjustmentFactor | No | a value representing the milliseconds needed to adjust any item's modification time due to time differences between the cc Server and the AllFusion Harvest server. |
debug | No | true or false used to display
additional information within the cc Server log. |
proprty | No | name of property to define if a modification is detected. |
<harvest userName="myUserName" password="myPassword" brokerName="myHarvestBrokerName" projectName="myHarvestPackage"/>
<httpfile>
<cruisecontrol> <project> <modificationset> <httpfile>
Checks a single file on a web server supporting modification dates (such as Apache). Intended to be used in a Compound modification set as a Trigger.
Attributes
Attribute | Required | Description |
---|---|---|
url | Yes | The HTTP URL of a file to check the modification date of |
username | No (defaults to "User") | The username to use for the reported Modification. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<mavensnapshotdependency>
<cruisecontrol> <project> <modificationset> <mavensnapshotdependency>
Triggers a build if a Maven snapshot detects a change.
Attributes
Attribute | Required | Description |
---|---|---|
projectFile | Yes | Maven POM file. |
user | Yes | The username to use when reporting modifications. |
localRepository | No | Local Maven JAR repository. Defaults to {user.home}/.maven/repository . |
propertiesFile | No | Sets the .properties file which contains overriding tags for POM. Default is build.properties. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<maven2snapshotdependency>
<cruisecontrol> <project> <modificationset> <maven2snapshotdependency>
Triggers a build if a Maven2 snapshot detects a change.
Attributes
Attribute | Required | Description |
---|---|---|
pomfile | Yes | maven2 POM file. |
user | Yes | The username to use when reporting modifications. |
localRepository | No (Not available until after maven v2.0.4+) | Local Maven2 JAR repository. Defaults to {user.home}/.m2/repository . |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<mks>
Triggers a build if there is a change within an MKS repository. Has the following prerequisites:
- The sandbox must always exists. The MKS sourcecontrol are unable to create the sandbox for you. In principle, this is not a real problem as long as the underlying MKS command si are able to handle such a task, but in this initial version I don't create a sandbox during runtime. If you not always create your sandbox, see si createsandbox for more information.
- You have already logged in into the MKS Server. This should be done in your bootstrap section by the ANT task siconnect. The underlying java class is situated in the mksant.jar which is available through the MKS Customer Community. Since this (and the corresponding sidisconnect) anttasks are only small wrapper for the command line call of si, this could be done in later versions by the MKS sourcecontroller itself. You should call the sidisconnect task after your build, e.g. during your publishing phase.
Attributes
Attribute | Required | Description |
---|---|---|
doNothing | No | If this attribute is set to true, no mks command is executed. This is for testing purposes, if a potentially slow MKS server connection should avoid |
localworkingdir | Yes | Local directory for the sandbox. |
project | Yes | The name of the MKS project file (mostly project.pj). |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<p4>
Triggers a build if there is a change within an Perforce repository.
Attributes
Attribute | Required | Description |
---|---|---|
correctForServerTime | No | Should CruiseControl correct for time differences between the Perforce server and the CruiseControl server? Defaults to true. |
port | Yes | Perforce Server connection to use (host:port) |
client | Yes | Perforce Client name to use |
user | Yes | Perforce User name to use |
passwd | No | Perforce password to use |
view | Yes | Valid Perforce view (i.e. a depot path) |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
usep4email | No | Should the Email address for the users be retrieved from Perforce if possible. Defaults to true. |
<plasticscm>
<cruisecontrol> <project> <modificationset> <plasticscm>
Checks for changes in a Plastic SCM repository.
Attributes
Attribute | Required | Description |
---|---|---|
wkspath | Yes | Valid Plastic SCM workspace path. |
branch | Yes | The branch in which changes will be looked for. |
repository | No | The repository in which changes will be looked for. |
Examples
- Used to check for changes in the branch br:/main.
<modificationset> <plasticscm wkpath="c:\work\cruise\plasticwks" branch="br:/main" /> <modificationset/>
<pvcs>
Checks for changes in a PVCS repository.
Attributes
Attribute | Required | Description |
---|---|---|
archivefilesuffix | no | Standard suffix for archive set when the repository is created. Default value is "-arc". |
loginid | no | Used to supply a user and password. Example: loginid="sampleuser:samplepassword" or loginid="sampleuser" |
pvcsproject | Yes | Project name. |
pvcssubproject | Yes | Subproject name. |
pvcsbin | No | Path to directory with pcli. |
pvcsversionlabel | No | The version label for the PVCS builder to check against. Example: pvcsVersionLabel="SampleVersionLabel" |
outdateformat | No (defaults to "MMM dd yyyy HH:mm:ss") | The format to use to parse the LastModified entry as produced by your pvcs system (See vlog.txt for format) |
indateformat | No (defaults to "MM/dd/yyyy/HH:mm") | The format used to parse the lastbuild date. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<snapshotcm>
<cruisecontrol> <project> <modificationset> <snapshotcm>
Checks for changes in a SnapshotCM repository.
Attributes
Attribute | Required | Description |
---|---|---|
sourcepaths | Yes | A semi-colon-separated list of source paths to check for modifications. All paths will be checked recursively. |
property | No | Property to be set if a modification has occurred. For use in conditionally controlling the build later. |
propertyondelete | No | Property to be set if a file has been deleted. For use in conditionally controlling the build later. |
<starteam>
<cruisecontrol> <project> <modificationset> <starteam>
Checks for changes in a Star Team repository.
If logged on as SERVER ADMINISTRATOR it will look up the email associated with the user account for each modification.
Attributes
Attribute | Required | Description |
---|---|---|
folder | Yes | The repository folder |
password | Yes | Password for the StarTeam user |
starteamurl | Yes | |
username | Yes | StarTeam user name |
preloadFileInformation | No (defaults to true) | When set to true can make the modification check much faster. |
property | No | Property to be set if a modification has occurred. For use in conditionally controlling the build later. |
propertyondelete | No | Property to be set if a file has been deleted. For use in conditionally controlling the build later. |
<surround>
<cruisecontrol> <project> <modificationset> <surround>
Attributes
Attribute | Required | Description |
---|---|---|
branch | No | Surround SCM branch name. The default is pulled from the local working directory. |
repository | No | Surround SCM repository path. The default is pulled from the local working directory. |
file | No | Enter a file or repository name or a searchable pattern. Can be / or empty, which means the repository specified by the repository option or the default repository. |
searchregexp | No | If set to 1, the file parameter will be interpreted as a regular expression. Options are 1 or 0 (default). |
recursive | No | Recursively check files and sub-repositories. Options are 1 or 0 (default). |
serverconnect | No | Enter the address and port number of the Surround SCM server host computer. Format is server:port. If not entered, the last saved connection parameters are used. |
serverlogin | No | Enter the username and password used to login to the Surround SCM server. Format is username:password. If not entered, the last saved login parameters are used. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<svn>
Checks for changes within a Subversion repository.
Attributes
Attribute | Required | Description |
---|---|---|
LocalWorkingCopy | One of these | Relative or absolute path to the local working copy of the Subversion repository of which to find the log history. |
RepositoryLocation | The url to the Subversion repository on which to find the log history. | |
username | No | used for authentication. |
password | No | used for authentication. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
propertyondelete | No | Set this property if a file has been deleted. For use in conditionally controlling the build later. |
<timebuild>
<cruisecontrol> <project> <modificationset> <timebuild>
Triggers a build after a particular time threshold. This will return a single modification from the (fake) user only if no successful build has happened since the last specified time threshold. Once a successful build occurs, no more modification is returned
Attributes
Attribute | Required | Description |
---|---|---|
username | No (defaults to "User") | The username to use for the single reported (fake) Modification. |
time | Yes | The threshold time to cross that starts triggering a build, specified
as hhmm format. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
<ucm>
Triggers a build if there is a change within a ClearCase UCM repository.
Attributes
Attribute | Required | Description |
---|---|---|
stream | Yes | The ClearCase UCM stream (actually, the branch, so make sure to enter the branch type if it is named differently than your UCM stream) |
contributors | No (defaults to false) | Whether to check for and log contributor activities |
viewpath | Yes | Local working copy to use when making queries |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
multiVob | No | Set whether the view contains multiple vobs. Defaults to false. |
Properties Passed to the Builders
In addition to the standard CruiseControl properties passed to builders, <ucm> sets the following properties:
Property Name | Description |
---|---|
ucmlastbuild | Timestamp representing the last built time, using the format dd-MMMM-yyyy.HH:mm:ss |
ucmnow | Timestamp representing the time the current build started, using
the format dd-MMMM-yyyy.HH:mm:ss |
<veto>
This plugin is designed to help enforce build order between dependent projects. It will check to see if a project is up to date and vetos the build attempt if it is not. Veto is configured by defining a nested set of sourcecontrols and a buildstatus element. If project foo depends on project bar then bar may have a <veto> with triggers that are the same as the modificationset for foo and a <buildstatus> that points to the logs for foo. If there is a change that would cause foo to build but bar is first in the build queue, then the <veto> in bar will detect that foo is out of date and abort the build attempt by throwing an exception.
Unlike most source controls, Veto never returns any modifications. Its only job is to abort builds when another project is out of date with respect to some set of modifications.
Child Elements
Element | Cardinality | Description |
---|---|---|
<triggers> |
1 | A container for one or more source control elements that
trigger a full check of the targets. Any child element of
<modificationset>
can be used as a child element of <triggers> . |
<buildstatus> |
1 | Points at the logs for the project that is checked to see if it is up to date with the modifications detected by the <triggers>. |
Example
In this if there are changes in the cvs repository for foo since the last time project foo built successfully then the veto will throw an exception and abort the build attempt. If there are no changes in the repository for foo or project foo is up to date then <veto> will do nothing and the build attempt will continue as normal (building if there are modifications detected in the reposiotry for bar).
<modificationset> <veto> <triggers> <cvs cvsroot=":pserver:user@cvs_repo.com:/cvs/foo" /> </triggers> <buildstatus logdir="logs/foo" /> </veto> <cvs cvsroot=":pserver:user@cvs_repo.com:/cvs/bar"/> </modificationset>
<vss>
Checks for changes in a Visual SourceSafe repository.
Attributes
Attribute | Required | Description |
---|---|---|
dateformat | No (defaults to default is MM/dd/yy) | The date format to use for querying VSS and processing reports. If your computer is set to a different region, you may wish to use a format such as dd/MM/yy. |
timeformat | No (default is hh:mma) | The time format to use for querying VSS and processing reports. If your VSS is configured differently you may need a different format such as HH:mm:ss. |
vsspath | Yes | The VSS project to get history from. Example: /Project/subproject |
login | Yes | The VSS login to use, in the form
username,password |
ssdir | No | Path to the directory containing ss.exe. By default,
ss.exe is assumed to be in the path. Note: should not contain whitespace. |
serverpath | No | Path to the directory containing srcsafe.ini. |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
propertyondelete | No | Set this property if a file has been deleted. For use in conditionally controlling the build later. |
<vssjournal>
<cruisecontrol> <project> <modificationset> <vssjournal>
Checks for changes in a Visual SourceSafe repository.
This implementation doesn't require the source safe executable making it suitable for use on non-Windows machines.
Attributes
Attribute | Required | Description |
---|---|---|
journalfile | Yes | Full path to journal file. Example: c:/vssdata/journal/journal.txt |
ssdir | Yes | The VSS project to get history from |
property | No | Set this property if a modification has occurred. For use in conditionally controlling the build later. |
propertyondelete | No | Set this property if a file has been deleted. For use in conditionally controlling the build later. |
<schedule>
<cruisecontrol> <project> <schedule>
CruiseControl allows the user to schedule an arbitrary number of builds, either on interval or triggered to run at a given date/time, as well as pause intervals during which no builds will be run. Be aware that builds will only run if modifications are found (or build is forced from JMX interface). Because of this it is usually not a good idea to mix time builds and multiple builds in the same project as the multiple builds will "eat" all the changes before they can be detected by the time based builds.
Note: Only one builder is used for a given interval where modifications are found. Builds using the time attribute take precedence over builds using the multiple attribute. If no matching time builds are found the multiple builds are evaluated in the order they appear in the file, so a multiple='1' on the first builder will hide all the subsequent builders.
Attributes
Attribute | Required | Description |
---|---|---|
interval | No | Interval period in seconds. Default value is 300 (five minutes). Maximum value is 31536000 (one year), but for the builders that ship with CruiseControl the maximum practical value is 604800 (one week). Ignored if schedule only has time based builders. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<ant> | 0 .. * | Builds the project using Ant. |
<composite> | 0 .. * | Executes a list of builds. |
<maven> | 0 .. * | Builds the project using Maven. |
<maven2> | 0 .. * | Builds the project using Maven2. |
<pause> | 0 .. * | Pauses the build. |
<nant> | 0 .. * | Builds the project using NAnt. |
<phing> | 0 .. * | Builds the project using Phing. |
Properties Passed to Builders
When CruiseControl runs your build script (Ant or Maven), it passes some information in the form of system properties to the script. These can be accessed in your script like any other property, using the syntax ${propertyname}.
Here's a list of all the properties that are available to your script:
Property Name | Description |
---|---|
projectname | The name of the CruiseControl project. |
label | The build label determined by the labelincrementer |
cvstimestamp | Timestamp that indicates when the build started, using the
format yyyy-MM-dd HH:mm:ss 'GMT' so it
can be used as a CVS argument |
cctimestamp | Timestamp that indicates when the build started, using the
format yyyyMMddHHmmss |
cclastgoodbuildtimestamp | Timestamp that indicates when the last successful build was
run, using the format yyyyMMddHHmmss |
cclastbuildtimestamp | Timestamp that indicates when the last build was run, using
the format yyyyMMddHHmmss |
lastbuildsuccessful | indicates if the last build was successful; either "true" or "false" |
Some child elements of <modificationset> also set properties for the builders. In particular:
- <buildstatus> sets specific properties.
- <clearcase> sets specific properties.
- If specified, the
property
orpropertyondelete
attribute value will be set. This feature is supported by <clearcase>, <cvs>, <filesystem>, <mavensnapshotdependency>, <maven2snapshotdependency>, <mks>, <snapshotcm>, <starteam>, <vss> and <vssjournal>.
<ant>
Specifies an Ant build to be run at a given time or build number. For instance, we can run a clean build every 5 builds, or run more comprehensive (and time intensive) system tests every 10 builds. We can also schedule an official build to run every night at midnight, if we so desire.
When a build runs, Ant is invoked in a separate Java process. There are two alternative ways in which ant may be invoked:
- Using the
antscript
, oranthome
, attribute (preferred) helps to ensure that builds are run completely independent of the CruiseControl distribution, and that extra jars required in the ant lib-directory need not be duplicated within CruiseControl. - Using the ant binaries distributed with CruiseControl. Settings
for the virtual machine can be specified using the nested
<jvmarg>
element. This also requires that java be on the executable path.
The standard CruiseControl properties passed to builders are available from within the ant build.
See below for examples of the
<ant>
element.
Attributes
Attribute | Required | Description |
---|---|---|
buildfile | No (defaults to build.xml) | Path to Ant build file. |
target | No | Ant target(s) to run. Default is "", or the default target for the build file. |
multiple | No | Build index used to run different builders. For example, if this is set to 3, the builder will be run every 3 builds. Default value is 1. Can't be set if time is set. |
time | No | Time in the form HHmm. Can't be set if multiple is set. |
day | No | Valid values are (case-insensitive) the English names for the days of the week (Sunday, Monday, Tuesday, etc). Does not support multiple days except for the default of every day. |
tempfile | No | Name of temp file. Defaults to log.xml |
antscript | No, but recommended. Cannot be specified if anthome attribute is also specified |
Absolute filename of script (shell script or bat file) used to start Ant. You can use this to make CruiseControl use your own Ant installation. If this is not specified, the AntBuilder uses the Ant distribution that ships with CruiseControl. See below for examples. |
anthome | No. Cannot be specified if antscript attribute is also specified. |
Directory in which Ant is installed. CruiseControl will attempt to use the standard Ant execution scripts (i.e. ant.bat or ant). See below for examples. |
antWorkingDir | No | Will invoke ant in the specified directory. |
saveLogDir | No | If supplied a copy of the ant log will be saved in the specified directory. Example: saveLogDir="/usr/local/dev/projects/cc/logs" |
timeout | No | Ant build will be halted if it continues longer than the specified timeout. Value in seconds. |
uselogger | No | 'true' if CruiseControl should call Ant using -logger; 'false' to call Ant using '-listener', thus using the loggerclass as a Listener. uselogger="true" will make Ant log its messages using the class specified by loggerclassname as an Ant Logger, which can make for smaller log files since it doesn't log DEBUG messages (see useDebug and useQuiet attributes below, and the Ant manual). Set to false to have Ant echo ant messages to console using its DefaultLogger, which is useful when debugging your ant build. Defaults to 'false' to make initial setup easier but setting it to 'true' is recommended for production situations. |
loggerclassname | No (defaults to org.apache.tools.ant.XmlLogger) | If you want to use another logger (or listener, when uselogger="false") than Ant's XmlLogger, you can specify the classname of the logger here. The logger needs to output compatible XML, and the class needs to be available on the classpath at buildtime. |
usedebug | No | If true will invoke ant with -debug, which can be useful for debugging your ant build. Defaults to 'false', cannot be set to 'true' if usequiet is also set to 'true'. When used in combination with uselogger="true", this will result in bigger XML log files; otherwise, it will cause more output to be written to the console by Ant's DefaultLogger. |
usequiet | No | If true will invoke ant with -quiet, which can be useful for creating smaller log files since messages with a priority of INFO will not be logged. Defaults to 'false', cannot be set to 'true' if usedebug is also set to 'true'. Smaller logfiles are only achieved when used in combination with uselogger="true", otherwise there will just be less output echoed to the console by Ant's DefaultLogger. |
keepgoing | No | If true will invoke ant with -keep-going, which can be useful for performing build steps after an optional step fails. Defaults to 'false'. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<jvmarg> | 0 .. * | Pass specified argument to the jvm used to invoke ant.
Ignored if using antscript. The element has a single required
attribute: "arg". Example: <jvmarg arg="-Xmx120m"/> |
<property> | 0 .. * | Used to define properties for the ant build. The element
has two required attributes: "name" and "value". These will
be passed on the ant command-line as "-Dname=value" Example: <property name="foo" value="bar"/> |
Examples
- Invoke the ant.bat script distributed with ant using the
antscript
attribute, specifying the working directory asD:\workspace\MyProject
and the ant build file asMyProject-nightlybuild.xml
using the default target.<schedule> <ant antscript="C:\Java\apache-ant-1.6.1\bin\ant.bat" antworkingdir="D:\workspace\MyProject" buildfile="MyProject-nightlybuild.xml" uselogger="true" usedebug="false"/> <schedule>
Or equivalently, using theanthome
attribute<schedule> <ant anthome="C:\Java\apache-ant-1.6.1" antworkingdir="D:\workspace\MyProject" buildfile="MyProject-nightlybuild.xml" uselogger="true" usedebug="false"/> <schedule>
- Invoke a custom ant script
/home/cc/workspace/build.sh
, specifying the working directory as/home/cc/workspace
and the ant target assmoketest
.<schedule> <ant antscript="/home/cc/workspace/build.sh" antworkingdir="/home/cc/workspace" target="smoketest" uselogger="true"/> <schedule>
The custom build script can be any shell script, batch file or program that understands how to invoke ant. Here is an example that would be appropriate under Unix:
#!/bin/sh PROJECT_HOME=`dirname "$0"` ANT_HOME=${PROJECT_HOME}/tools/ant chmod 0755 ${ANT_HOME}/bin/ant ANT_CMD=${ANT_HOME}/bin/ant exec "$ANT_CMD" "$@"
Note the double quotes around $@: this ensures that all arguments will be quoted, which is necessary for arguments containing spaces.
An example of a Windows batch file to invoke ant:
@echo off setlocal set PROJECT_HOME=%~dp0 call %PROJECT_HOME%..\devtools\env.bat call ant.bat %* endlocal
The %* as a param to ant.bat is important — it means that all the arguments to build.bat are passed along to ant.bat. If this is skipped then CruiseControl wouldn't work properly.
<maven>
<cruisecontrol> <project> <schedule> <maven>
Specify a Maven build to be run at a given time or build number. Basically, it behaves like the AntBuilder, with some differences noted below. MavenBuilder runs (an already installed copy of) Maven over the specified project. Due to the current status of Maven (in heavy development) only the "script" start mode is supported.
The goal
attribute has the following usage examples:
- "clean" will run 'clean' goal on the project
- "clean java:compile" will run 'clean' goal then 'java:compile' goal on the project, within the same Maven session run
- "clean my-cvs-update|java:compile" will run 'clean' goal then 'my-cvs-update' goal on the project, within the same Maven session run, then it will run Maven again with goal 'java:compile'. Handy behavior for running update goals that update the "project.xml" itself (or the like). Arbitrary number of subsets allowed . Subset separator is '|'.
The standard CruiseControl properties passed to builders are available from within the maven build.
Attributes
Attribute | Required | Description |
---|---|---|
mavenscript | Yes | Absolute filename of maven startup script (maven.bat or maven.sh). |
projectfile | Yes | Path to Maven's "project.xml" file |
goal | Yes | Maven goal, "set of goals" or "set of set of goals" to run. (see above Note2) |
multiple | No | Build index used to run different builders. For example, if this is set to 3, the builder will be run every 3 builds. Default value is 1. Can't be set if time is set. |
time | No | Time in the form HHmm. Can't be set if multiple is set. |
day | No | Valid values are (case-insensitive) the English names for the days of the week (Sunday, Monday, Tuesday, etc). Does not support multiple days except for the default of every day. |
<maven2>
<cruisecontrol> <project> <schedule> <maven2>
Specify a Maven2 build to be run at a given time or build number. Basically, it behaves like the AntBuilder, with some differences noted below. Maven2Builder runs (an already installed copy of) Maven2 over the specified project. Due to the current status of Maven (in heavy development) only the "script" start mode is supported.
The goal
attribute has the following usage examples:
- "clean" will run 'clean' goal on the project
- "clean compile" will run 'clean' goal then 'compile' goal on the project, within the same Maven2 session run
- "clean my-cvs-update|compile" will run 'clean' goal then 'my-cvs-update' goal on the project, within the same Maven session run, then it will run Maven again with goal 'compile'. Handy behavior for running update goals that update the "pom.xml" itself (or the like). Arbitrary number of subsets allowed . Subset separator is '|'.
The standard CruiseControl properties
passed to builders are available from within the maven build, with one exception: The
"cvstimestamp" property contains spaces in its value, like:
-Dcvstimestamp=2006-11-29 03:41:04 GMT
. To avoid problems when maven2 parses
this property from the command line, spaces in build property values will be replaced
with underscores, like: -Dcvstimestamp=2006-11-29_03:41:04_GMT
.
Attributes
Attribute | Required | Description |
---|---|---|
mvnscript | One of these | Path to maven startup script (.../bin/mvn.bat or mvn.sh). |
mvnhome | Path to Maven2's home directory (M2_HOME). Maven script will be found by appending "/bin/mvn" (or "/bin/mvn.bat") to this directory. | |
pomfile | Yes | Path to Maven2's "pom.xml" file |
goal | Yes | Maven2 goal, "set of goals" or "set of set of goals" to run. (see Goals note above) |
settingsfile | No | Alternate path for the user settings file. |
activateprofiles | No | Comma-delimited list of profiles to activate. |
flags | No | Command line flags to be passed to maven. For example: '-U -Dmaven.test.skip=true'. The flags will be passed to each session invocation (see Sessions note above). |
multiple | No | Build index used to run different builders. For example, if this is set to 3, the builder will be run every 3 builds. Default value is 1. Can't be set if time is set. |
time | No | Time in the form HHmm. Can't be set if multiple is set. |
day | No | Valid values are (case-insensitive) the English names for the days of the week (Sunday, Monday, Tuesday, etc). Does not support multiple days except for the default of every day. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<property> | 0 .. * | Used to define properties for the maven2 build. The element
has two required attributes: "name" and "value". These will
be passed on the maven2 command-line as "-Dname=value" to each session
invocation (see Sessions note above). Example: <property name="foo" value="bar"/> |
<composite>
<cruisecontrol> <project> <schedule> <composite>
The CompositeBuilder executes a list of builders. This is necessary for builds in an empty directory (see keyword CRISP-builds in Pragmatic Project Automation from Mike Clark)
Child Elements
Element | Cardinality | Description |
---|---|---|
<ant> | 0 .. * | Builds the project using Ant. |
<maven> | 0 .. * | Builds the project using Maven. |
<maven2> | 0 .. * | Builds the project using Maven2. |
<pause> | 0 .. * | Pauses the build. |
<nant> | 0 .. * | Builds the project using NAnt. |
<phing> | 0 .. * | Builds the project using Phing. |
<exec> | 0 .. * | Builds the project using the ExecBuilder. |
<pause>
<cruisecontrol> <project> <schedule> <pause>
It may be necessary for CruiseControl to halt executing in some circumstances. A disk backup could lock the source control repository, causing CruiseControl to return errors. Rather than deal with these errors all the time, we can specify a time period for CruiseControl to not attempt any builds.
Attributes
Attribute | Required | Description |
---|---|---|
day | No | Day when the pause should take place (Sunday, Monday, etc). Does not support multiple days except for the default of every day. |
starttime | Yes | Start of the pause in HHmm format |
endtime | Yes | End of the pause in HHmm format |
<nant>
<cruisecontrol> <project> <schedule> <nant>
Specifies a NAnt build to be run at a given time or build number. For instance, we can run a clean build every 5 builds, or run more comprehensive (and time intensive) system tests every 10 builds. We can also schedule an official build to run every night at midnight, if we so desire.
When a build runs, NAnt is invoked in a separate Java process. NAnt and the .NET Framework or Mono need to be installed for this builder to function. See NAnt's documentation for details on configuration and compatibility with .NET implementations.
The standard CruiseControl properties passed to builders are available from within the NAnt build.
See below for examples of the
<nant>
element.
Attributes
Attribute | Required | Description |
---|---|---|
buildfile | No (defaults to default.build) | Path to NAnt build file. |
target | No | NAnt target(s) to run. Default is "", or the default target for the build file. |
multiple | No | Build index used to run different builders. For example, if this is set to 3, the builder will be run every 3 builds. Default value is 1. Can't be set if time is set. |
time | No | Time in the form HHmm. Can't be set if multiple is set. |
day | No | Valid values are (case-insensitive) the English names for the days of the week (Sunday, Monday, Tuesday, etc). Does not support multiple days except for the default of every day. |
tempfile | No | Name of temp file. Defaults to log.xml |
targetFramework | No, but recommended | Specifies the framework to target. Typical values are "net-1.1" and "mono-1.0". |
nantWorkingDir | No | Will invoke NAnt in the specified directory. |
timeout | No | NAnt build will be halted if it continues longer than the specified timeout. Value in seconds. |
uselogger | No | 'true' if CruiseControl should call NAnt using -logger; 'false' to call NAnt without '-logger', thus using the loggerclass as a Listener. uselogger="true" will make NAnt log its messages using the class specified by loggerclassname as a NAnt Logger, which can make for smaller log files since it doesn't log DEBUG messages (see useDebug and useQuiet attributes below, and the NAnt documentation). Listener will echo NAnt messages to console which is useful when debugging your NAnt build. Defaults to 'false' for historical reasons, but setting it to 'true' is recommended for production situations. |
loggerclassname | No (defaults to NAnt.Core.XMLLogger) | If you want to use another logger than NAnt's XmlLogger, you can specify the classname of the logger here. The logger needs to output compatible XML, and the class needs to be available on the classpath at buildtime. |
usedebug | No | If true will invoke NAnt with -debug, which can be useful for debugging your NAnt build. Defaults to 'false', cannot be set to 'true' if usequiet is also set to 'true'. Is only effective when used in combination with uselogger="true"! |
usequiet | No | If true will invoke NAnt with -quiet, which can be useful for creating smaller log files since messages with a priority of INFO will not be logged. Defaults to 'false', cannot be set to 'true' if usedebug is also set to 'true'. Is only effective when used in combination with uselogger="true"! |
Child Elements
Element | Cardinality | Description |
---|---|---|
<property> | 0 .. * | Used to define properties for the NAnt build. The element
has two required attributes: "name" and "value". These will
be passed on the NAnt command-line as "-D:name=value" Example: <property name="foo" value="bar"/> |
Examples
- Invoke NAnt, specifying the
working directory as
D:\workspace\MyProject
and the NAnt build file asMyProject-nightly.build
using the default target.<schedule> <nant nantworkingdir="D:\workspace\MyProject" buildfile="MyProject-nightly.build" uselogger="true" usedebug="false"/> <schedule>
- Invoke NAnt, specifying the working directory as
/home/cc/workspace
, the build file asdefault.build
, the nant target assmoketest
, and the targetframework as .NET version 1.1.<schedule> <nant targetframework="net-1.1" nantworkingdir="/home/cc/workspace" target="smoketest" uselogger="true"/> <schedule>
<phing>
<cruisecontrol> <project> <schedule> <phing>
Specifies a Phing build to be run at a given time or build number. For instance, we can run a clean build every 5 builds, or run more comprehensive (and time intensive) system tests every 10 builds. We can also schedule an official build to run every night at midnight, if we so desire.
When a build runs, Phing is invoked in a separate Java process. Phing and the PHP requisites need to be installed for this builder to function. See Phing's documentation for details on installation and configuration.
The standard CruiseControl properties passed to builders are available from within the Phing build.
See below for examples of the
<phing>
element.
Attributes
Attribute | Required | Description |
---|---|---|
buildfile | No (defaults to build.xml) | Path to Phing build file. |
target | No | Phing target(s) to run. Default is "", or the default target for the build file. |
multiple | No | Build index used to run different builders. For example, if this is set to 3, the builder will be run every 3 builds. Default value is 1. Can't be set if time is set. |
time | No | Time in the form HHmm. Can't be set if multiple is set. |
day | No | Valid values are (case-insensitive) the English names for the days of the week (Sunday, Monday, Tuesday, etc). Does not support multiple days except for the default of every day. |
tempfile | No | Name of temp file. Defaults to log.xml |
phingscript | No. Cannot be specified if phinghome attribute is also specified |
Absolute filename of script (shell script or bat file) used to start Phing. If this is not specified, the PhingBuilder assumes that phing (or phing.bat) is installed on your path. |
phinghome | No. Cannot be specified if phingscript attribute is also specified. |
Directory in which Phing is installed. CruiseControl will attempt to use the standard Phing execution scripts (i.e. phing.bat or phing). See below for examples. |
phingWorkingDir | No | Will invoke phing in the specified directory. |
saveLogDir | No | If supplied a copy of the phing log will be saved in the specified directory. Example: saveLogDir="/usr/local/dev/projects/cc/logs" |
timeout | No | Phing build will be halted if it continues longer than the specified timeout. Value in seconds. |
uselogger | No | 'true' if CruiseControl should call Phing using -logger; 'false' to call Phing using '-listener', thus using the loggerclass as a Listener. uselogger="true" will make Phing log its messages using the class specified by loggerclassname as a Phing Logger, which can make for smaller log files since it doesn't log DEBUG messages (see useDebug and useQuiet attributes below, and the Phing manual). Set to false to have Phing echo messages to console using its DefaultLogger, which is useful when debugging your Phing build. Defaults to 'false' to make initial setup easier but setting it to 'true' is recommended for production situations. |
loggerclassname | No (defaults to phing.listener.XmlLogger) | If you want to use another logger (or listener, when uselogger="false") than Phing's XmlLogger, you can specify the classname of the logger here. The logger needs to output compatible XML, and the class needs to be available on the classpath at buildtime. |
usedebug | No | If true will invoke phing with -debug, which can be useful for debugging your phing build. Defaults to 'false', cannot be set to 'true' if usequiet is also set to 'true'. When used in combination with uselogger="true", this will result in bigger XML log files; otherwise, it will cause more output to be written to the console by Phing's DefaultLogger. |
usequiet | No | If true will invoke phing with -quiet, which can be useful for creating smaller log files since messages with a priority of INFO will not be logged. Defaults to 'false', cannot be set to 'true' if usedebug is also set to 'true'. Smaller logfiles are only achieved when used in combination with uselogger="true", otherwise there will just be less output echoed to the console by Phing's DefaultLogger. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<property> | 0 .. * | Used to define properties for the phing build. The element
has two required attributes: "name" and "value". These will
be passed on the phing command-line as "-Dname=value" Example: <property name="foo" value="bar"/> |
Examples
- Invoke the phing.bat script distributed with phing using the
phingscript
attribute, specifying the working directory asD:\workspace\MyProject
and the phing build file asMyProject-nightlybuild.xml
using the default target.<schedule> <phing phingscript="C:\PHP\applications\phing-2.3.0\bin\phing.bat" phingworkingdir="D:\workspace\MyProject" buildfile="MyProject-nightlybuild.xml" uselogger="true" usedebug="false"/> <schedule>
Or equivalently, using thephinghome
attribute<schedule> <phing phinghome="C:\PHP\applications\phing-2.3.0\bin\" phingworkingdir="D:\workspace\MyProject" buildfile="MyProject-nightlybuild.xml" uselogger="true" usedebug="false"/> <schedule>
<exec>
<cruisecontrol> <project> <schedule> <exec>
Runs a specified command or script as part of the build. Reports build failure if the command cannot be run or returns an error. There is also a capability to search for a user defined string in the command output, for example, "build failed" and if so return an error.
See below for examples of the
<exec>
element.
Attributes
Attribute | Required | Description |
---|---|---|
command | Yes | The command or script to be executed. |
args | No | Set of arguments (as a single string) to be passed to the command or script. |
workingdir | No | The directory in which the script or command is to be executed. Defaults to the Java temporary directory. |
errorstr | No | String which is to be searched for in the output of the command or script. If it is found then the build will return an error. |
timeout | No | Build will be halted if the script or command continues longer than the specified timeout. Value in seconds. |
Examples
- Invoke execbuilder, specifying the
working directory as
/workspace/myproject
and executing the Perl scriptbackup.pl
.<schedule> <exec workingdir="/workspace/myproject" command="/usr/local/bin/Perl" args="backup.pl"/> </schedule>
- Invoke execbuilder, specifying the working directory as
D:\Workspace\MyProject
, the script file asbuild.bat
, its arguments assmoketest
, and the error message to be search for asbuild failed
.<schedule> <exec command="build.bat" workingdir="D:\Workspace\MyProject" args="smoketest" errorstr="build failed"/> </schedule>
<log>
<cruisecontrol> <project> <log>
Optional element specifies where cruisecontrol log files are stored and, via the nested merge element, specifies what xml files created by the build process should be merged into the CruiseControl build log.
Attributes
Attribute | Required | Description |
---|---|---|
dir | No | The cruisecontrol log directory. Default is "logs/[projectname]". |
encoding | No | Encoding for CruiseControl's XML log file. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<merge> |
0 .. * | Merges log file together. |
<gzip> |
0 .. 1 | GZips old log files |
<delete> |
0 .. 1 | Deletes old log files. |
<merge>
<cruisecontrol> <project> <log> <merge>
After the build is complete, there may be other xml artifacts to merge into the cruisecontrol log. The most common of these is the junit test results that the Ant <junit> task creates. We can add a merge entry for these files so that we have one comprehensive log at the end of a cruisecontrol build.
Attributes
Attribute | Required | Description |
---|---|---|
file | One of file or dir. | path to file to merge into build log |
dir | all files matching the specified pattern will be merged into the build log. | |
removeproperties | No (defaults to true) | when merging a JUnit xml file should the properties section be removed. |
pattern | No | Specifies the pattern which matches the filenames to merge. This pattern should be a valid Jakarta-ORO Glob pattern. Defaults to "*.xml". |
<gzip>
<cruisecontrol> <project> <log> <gzip>
After the build-file is written, this manipulator gzips all old log files that may exist.
Attributes
Attribute | Required | Description |
---|---|---|
every | true | Sets the amount of Units after which the logfiles are backuped. |
unit | true | The Unit for backups. Valid Units are DAY, WEEK, MONTH or YEAR |
<delete>
<cruisecontrol> <project> <log> <delete>
After the build-file is written, this manipulator deletes all old log files that may exist.
Attributes
Attribute | Required | Description |
---|---|---|
every | true | Sets the amount of Units after which the logfiles are backuped. |
unit | true | The Unit for backups. Valid Units are DAY, WEEK, MONTH or YEAR |
ignoreSuffix | true | Ignores default xml-suffix when deleting files, so other logfiles could be deleted |
<publishers>
<cruisecontrol> <project> <publishers>
Publishers are run after a build has completed. They will be run regardless of whether the build was successful or not.
Child Elements
Element | Cardinality | Description |
---|---|---|
<antpublisher> |
0 .. * | Executes an Ant script which implements a custom publisher. |
<artifactspublisher> |
0 .. * | Copies build products to a directory |
<clearcasebaselinepublisher> |
0 .. * | Creates a ClearCase UCM baseline. |
<cmsynergybaselinepublisher> |
0 .. * | Creates an intermediate baseline in a CM Synergy database. |
<cmsynergytaskpublisher> |
0 .. * | Copies all new CM Synergy tasks into a shared folder. |
<currentbuildstatuspublisher> |
0 .. * | Writes the time of the next build to a file |
<email> |
0 .. * | Sends an email with a URL to the build results JSP |
<execute> |
0 .. * | Execute a command as part of the publishing phase |
<ftppublisher> |
0 .. * | Copies the log file and build artifacts to an FTP server |
<htmlemail> |
0 .. * | Sends an email with the build results embedded as HTML |
<jabber> |
0 .. * | Sends an instant message with a link to the build results via a Jabber server using XMPP |
<onfailure> |
0 .. 1 | Executes all publishers specified as child elements if and only if the current build failed. |
<onsuccess> |
0 .. 1 | Executes all publishers specified as child elements if and only if the current build was successful. |
<sametimeannouncement> |
0 .. * | Sends Sametime announcements with the result of the build |
<scp> |
0 .. * | Copies a file using SCP |
<sfeedocman> |
0 .. * | Uploads a document to a SourceForge Enterprise Edition project's Document Manager. |
<sfeefrs> |
0 .. * | Uploads a file to a SourceForge Enterprise Edition project's file release system (FRS). |
<sfeetracker> |
0 .. * | Creates a Tracker artifact in a SourceForge Enterprise Edition project. |
<socket> |
0 .. * | Writes "Success" or "Failure" to a socket |
<x10> |
0 .. * | Controls an x10 electronic device |
<xsltlogpublisher> |
0 .. * | Performs a transformation of the log file |
<yahoopublisher> |
0 .. * | Sends an instant message with a link to the build results via a Yahoo IM message |
<antpublisher>
<cruisecontrol> <project> <publishers> <antpublisher>
Executes an Ant script which implements a custom publisher.
Attributes
The antpublisher uses the same attributes as the <ant> builder.Child Elements
The antpublisher supports the same set of child elements as the <ant> builder.Properties Passed to the Publisher
In addition to the standard CruiseControl
properties, <antpublisher>
passes the following
properties to Ant, which can be accessed in your script like any other
property, using the syntax ${propertyname}
.
Property Name | Description |
---|---|
thisbuildsuccessful | Set to true if the current build was successful, false otherwise. See also the <onsuccess> and <onfailure>. |
projectname | The name of the CruiseControl project. |
lastbuild | The timestamp of the last attempted build, using the format
yyyyMMddHHmmss . |
lastsuccessfulbuild | The timestamp of the last successful build, using the format
yyyyMMddHHmmss . |
builddate | The date of the last build, formatted using the default or specified <dateformat>. |
interval | The time interval between builds. |
logdir | The directory containing the log file from the last build. |
logfile | The name of the log file from the last build. |
Examples
- Invoke the ant.bat script distributed with ant, specifying the
working directory as
D:\workspace\MyProject
and the ant build file asMyProject-nightlybuild.xml
and the ant target aspublish
. Pass in the property "custom" with a value of "true".<publishers> <antpublisher antscript="C:\Java\apache-ant-1.6.1\bin\ant.bat" antworkingdir="D:\workspace\MyProject" buildfile="MyProject-nightlybuild.xml" uselogger="true" usedebug="false" target="publish"> <property name="custom" value="true"/> </antpublisher> </publishers>
You could then do something like the following in
MyProject-nightlybuild.xml
:<project name="MyProject-nightlybuild" default="publish"> <target name="publish"> <echo>custom is set to ${custom}</echo> <concat> <filelist dir="${logdir}" files="${logfile}"/> </concat> </target> </project>
<artifactspublisher>
<cruisecontrol> <project> <publishers> <artifactspublisher>
Copies build products to unique destination directory based on the build timestamp.
Attributes
Attribute | Required | Description |
---|---|---|
file | one of file or dir | will copy specified file |
dir | will copy all files from this directory | |
dest | Yes | parent directory of actual destination directory; actual destination directory name will be the build timestamp. |
subdirectory | No | subdirectory under the unique (timestamp) directory to contain artifacts |
publishOnFailure | No (defaults to true) | Deprecated. Use <onsuccess> and
<onfailure> instead. set this attribute to false to stop the publisher from running when the build fails. |
<clearcasebaselinepublisher>
<cruisecontrol> <project> <publishers> <clearcasebaselinepublisher>
Creates a ClearCase UCM baseline for the specified view's integration stream.
Uses the value of the CruiseControl generated ${label}
property
as well as the value of the baselineprefix
attribute (if specified)
to name the baseline. A baseline is only created if UCM modifications are recorded
in the build log. By default an incremental baseline is created although a full
baseline can be created too (incremental baselines are recommended for
Continuous Integration).
Attributes
Attribute | Required | Description |
---|---|---|
viewtag | Yes | The view tag of the UCM view that you wish to create the baseline in. The baseline is created in the stream that the view is attached to. |
full | No | Boolean value indicating whether a "Fully Labelled" or "Incremental" baseline should be created. Default is false, i.e. "Incremental". |
baselineprefix | No | A prefix which should be applied together with the CruiseControl
${label} property, for example specifying "EXAMPLE_"
with a CruiseControl generated label of "1_INT" would create a
baseline called "EXAMPLE_1_INT". |
component | No | The component to restrict the baseline creation to. By default the baseline is applied to all of the stream's changed components. |
Examples
- Create a baseline with the name "J2EE_" followed by the CruiseControl generated
build label using the view tag "j2ee_int" and restricting the baseline to the
"J2EE_SRC" component.
<publishers> <clearcasebaselinepublisher viewtag = "j2ee_int" baselineprefix = "J2EE_" component = "J2EE_SRC"/> </publishers>
<cmsynergybaselinepublisher>
<cruisecontrol> <project> <publishers> <cmsynergybaselinepublisher>
Creates an intermediate baseline which encompass the specified project and all of it's subprojects. This publisher will only run if the build was successful and the modification set contains at least one new CM Synergy task. This publisher will only work with CM Synergy version 6.3 or later.
Attributes
Attribute | Required | Description |
---|---|---|
ccmexe | No | The name of the CM Synergy command line client. If not provided, the plugin will search the system path for an executable called "ccm" (or "ccm.exe" for Windows). |
sessionfile | No | The session file used by the <cmsynergysessionmonitor> to persist your CM Synergy session information. If this attribute is not set, it defaults to the file ".ccmsessionmap" in your home directory. |
sessionname | No | The session name of the CM Synergy session you wish to use. This name must appear in the session file. If not set, the plugin will attempt to use the default (current) session as returned by the "ccm status" command. |
project | Yes | The project spec (two part name) of the project you wish to form the top level project of the baseline. Note that all subprojects will also be included. |
purpose | No | The purpose of the baseline. If not specified, this will default to "Integration Testing". |
description | No | An optional description of the baseline. |
baselinename | No | An optional name for the baseline. If not provided, CM Synergy will assign a default name based upon the current date. You may incorporate the value of any property set by CruiseControl (in the "info" section of the log) by using the macro "@{property}". |
Examples
- Create a baseline with the name "BUILD_" followed by the CC timestamp for the
purpose of "Integration Testing" using the session called "j2ee_session"
incorporating the "j2ee~1.0_int" project and all subprojects.
<publishers> <cmsynergybaselinepublisher sessionname = "j2ee_session" project = "j2ee~1.0_int" baselinename = "BUILD_@{cctimestamp}"/> </publishers>
<cmsynergytaskpublisher>
<cruisecontrol> <project> <publishers> <cmsynergytaskpublisher>
The <cmsynergytaskpublisher> is used to copy tasks into a shared folder. The folder may be specified by number, or by providing the 2 part name of the project as well as a substring of the folder's name. This publisher will only run if the build was successful and the modification set contains at least one new CM Synergy task.
Attributes
Attribute | Required | Description |
---|---|---|
ccmexe | No | The name of the CM Synergy command line client. If not provided, the plugin will search the system path for an executable called "ccm" (or "ccm.exe" for Windows). |
sessionfile | No | The session file used by the <cmsynergysessionmonitor> to persist your CM Synergy session information. If this attribute is not set, it defaults to the file ".ccmsessionmap" in your home directory. |
sessionname | No | The session name of the CM Synergy session you wish to use. This name must appear in the session file. If not set, the plugin will attempt to use the default (current) session as returned by the "ccm status" command. |
foldernumber | Either foldernumber or foldername and project | The number of the target folder. |
foldername | A substring of the name of the target folder (i.e. "Integration tested tasks"). If this attribute is set, you must also set the project attribute. | |
project | The two part name of the project which contains the named folder. |
Examples
- Publish all new tasks into folder number 203 using the CM Synergy session
named "j2ee_session".
<publishers> <cmsynergytaskpublisher sessionname = "j2ee_session" foldernumber = "203"/> </publishers>
- Publish all new tasks into the folder called "Integration tested tasks
for release j2ee/1.0" found in the project "j2ee~1.0_int" using the CM
Synergy session named "j2ee_session".
<publishers> <cmsynergytaskpublisher sessionname = "j2ee_session" project = "j2ee~1.0_int" foldername = "Integration tested tasks"/> </publishers>
<currentbuildstatuspublisher>
<cruisecontrol> <project> <publishers> <currentbuildstatuspublisher>
Note: this plugin has been made obsolete by the
currentbuildstatuslistener
.
The CruiseControl Build Results JSP will indicate whether or not CruiseControl is currently building a project. To get this information to the JSP, we write an HTML snippet to disk in a location where the JSP can read it. This file will consist of the time the next build attempt will take place, so there is an optional attribute to customize the dateformat.
This plugin is used in tandem with the
currentbuildstatusbootstrapper
.
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | The filename to write |
dateformat | No | Optionally customize the dateformat used in this file |
<execute>
<cruisecontrol> <project> <publishers> <execute>
Execute a command as part of the publishing phase.
Attributes
Attribute | Required | Description |
---|---|---|
command | Yes | The command to execute |
<scp>
SCP a file as part of the publishing process.
Attributes
Attribute | Required | Description |
---|---|---|
executableName | No | Specify the name of the executable to invoke. Default is "scp". |
sourceuser | Yes if sourcehost is specified | Log in to the sourcemachine as this user. |
sourcehost | Yes if sourceuser is specified | SCP from this machine. |
sourcedir | No (defaults to '.') | The directory to copy from. |
targetuser | Yes if targethost is specified | Log in to the target machine as this user. |
targethost | Yes if targetuser is specified | SCP to this machine. |
targetdir | No (defaults to '.') | The directory to copy to. |
targetseparator | No (defaults to File.separator on the source machine) | The file separator on the target machine. |
sourceseparator | No (defaults to File.separator on the source machine) | The file separator on the source machine. Useful when using an alternate shell environment, e.g. Cygwin, that expects a separator that differs from the native OS. |
ssh | No (defaults to 'ssh') | The ssh application. |
options | No | Additional options to pass to SCP. |
file | No (defaults to the current logfile) | The filename to copy. |
<sfeedocman>
<cruisecontrol> <project> <publishers> <sfeedocman>
Creates a Document Manager document in a SourceForge Enterprise Edition project. All child elements may include either hardcoded values, or use an xpath expression to define the value at runtime.
NOTE: To use this publisher, you must supply the jars included in the SourceForge SOAP SDK.
The publisher is compiled against a stub implementation of that SDK. Remove the stub jar
(inmemorysfee-x.x.x.jar
) and put the SDK jars in its place and make them available in
CruiseControl's classpath.
Attributes
Attribute | Required | Description |
---|---|---|
serverurl | Yes | URL for the SFEE instance. |
username | Yes | Valid username for the specified SFEE instance. |
password | Yes | Password for the specified username. |
document | Yes | The path to the document to publish. |
folder | Yes | The Document Manager folder in which to publish. |
projectName | Yes | The name of the SFEE project where the Document Manager folder specified exists. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<description> |
1 | The description for the Document. This child element is required and is an XPath Aware Child. Look there for attribute details. |
<status> |
1 | The status for the Document. This child element is required and is an XPath Aware Child. Look there for attribute details. |
<documentname> |
0..1 | The name for the Document within the Document Manager. If a Document Manager entry already exists in the specified folder with the same name, then the document being published will be added as a new version. If this child is not included, it will default to the name of the file being published. This child element is optional and is a XPath Aware Child. Look there for attribute details. |
<versioncomment> |
0..1 | The version comment for the Document. This child element is optional and is a XPath Aware Child. Look there for attribute details. |
Examples
<!-- Upload Project.xls to SFEE, using XPath to set the description to the date and time of each build. --> <sfeedocman file="target/myapp-1.0.0.jar" serverurl="http://mysfeeinstance.com" username="sfeeuser" password="mypassword" projectname="myproject" folder="/Root Folder/" document="projects/myproject/Project.xls"> <description xpathexpression="/cruisecontrol/info/property[@name='builddate']/@value"/> <status value="final"/> </sfeedocman>
<sfeefrs>
<cruisecontrol> <project> <publishers> <sfeefrs>
Uploads a file to a SourceForge Enterprise Edition project's file release system (FRS).
NOTE: To use this publisher, you must supply the jars included in the SourceForge SOAP SDK.
The publisher is compiled against a stub implementation of that SDK. Remove the stub jar
(inmemorysfee-x.x.x.jar
) and put the SDK jars in its place and make them available in
CruiseControl's classpath.
Attributes
Attribute | Required | Description |
---|---|---|
file | Yes | Path to a file on the local filesystem that should be uploaded. |
serverurl | Yes | URL for the SFEE instance. |
username | Yes | Valid username for the specified SFEE instance. |
password | Yes | Password for the specified username. |
releaseid | Yes | The SFEE id for the FRS release, e.g. rel2509. |
uploadname | No (defaults to the same name as the local file) | The name to be used for the file in the FRS. |
Examples
<!-- Upload myapp-1.0.0.jar to SFEE using the same filename. --> <sfeefrs file="target/myapp-1.0.0.jar" serverurl="http://mysfeeinstance.com" username="sfeeuser" password="mypassword" releaseid="rel2509"/>
<!-- Upload myapp-1.0.0.jar to SFEE, but call it myapp-current.jar in the FRS. --> <sfeefrs file="target/myapp-1.0.0.jar" serverurl="http://mysfeeinstance.com" username="sfeeuser" password="mypassword" releaseid="rel2509" uploadname="myapp-current.jar"/>
<sfeetracker>
<cruisecontrol> <project> <publishers> <sfeetracker>
Creates a Tracker artifact in a SourceForge Enterprise Edition project. Artifact fields are defined as subelements, where the always mandatory fields title, description and status are required children. Other fields with arbitrary names and values are defined as "field" subelements. All fields may include either hardcoded values, or use an xpath expression to define the value at runtime.
NOTE: To use this publisher, you must supply the jars included in the SourceForge SOAP SDK.
The publisher is compiled against a stub implementation of that SDK. Remove the stub jar
(inmemorysfee-x.x.x.jar
) and put the SDK jars in its place and make them available in
CruiseControl's classpath.
Attributes
Attribute | Required | Description |
---|---|---|
trackerName | Yes | The name of the Tracker within the specified SFEE project. |
projectName | Yes | The name of the SFEE project where the tracker specified exists. |
serverurl | Yes | URL for the SFEE instance. |
username | Yes | Valid username for the specified SFEE instance. |
password | Yes | Password for the specified username. |
Child Elements
Element | Cardinality | Description |
---|---|---|
<title> |
1 | The title for the tracker artifact. This child element is required and is an XPath Aware Child. Look there for attribute details. |
<description> |
1 | The description for the tracker artifact. This child element is required and is an XPath Aware Child. Look there for attribute details. |
<status> |
1 | The status for the tracker artifact. This child element is required and is an XPath Aware Child. Look there for attribute details. |
<field> |
0..* | Sets a field that exists in the tracker artifact. This child element is optional and is a Named XPath Aware Child. Look there for attribute details. |
Examples
<!-- Creates a new SFEE tracker entry for monitoring unit test statistics. --> <sfeetracker serverurl="http://my.sourceforge.instance" username="user" password="pass" trackerName="UnitTestStatistics" projectName="mysfeeproject"> <title value="Unit Tests" /> <description value="The test statistics from my SFEE project." /> <status value="Closed" /> <field name="TotalNumberOfUnitTests" xpathExpression="sum(cruisecontrol/testsuite/@tests)" /> </sfeetracker>
<email>
<cruisecontrol> <project> <publishers> <email>
Sends an email with a URL to the build results JSP.
Attributes
Attribute | Required | Description |
---|---|---|
buildresultsurl | Yes | URL to the build results JSP |
defaultsuffix | No | Default e-mail suffix to append to user names to build valid e-mail addresses. This defaults to an empty string if not specified. |
failasimportant | No | Flag emails about failed builds as important? Default is 'true'. |
mailhost | Yes | Mail server address |
mailport | No | Mail server port |
username | if password is specified | Username for smtp server |
password | if username is specified | Password for smtp server |
reportsuccess | No (defaults to always | Valid values:
|
returnaddress | Yes | E-mail address that will appear in the sent email's From field |
returnname | No | A name to match to the return address |
skipusers | No (defaults to false) | Controls if the users who made changes in this build get email. Useful to set to "true" while configuring or debugging your system. Users specified by the failure or always nested elements will still receive email. |
spamwhilebroken | No (defaults to true) | Whether or not e-mail reports on failed builds will continue for subsequent failed builds. |
subjectprefix | No | Prefix for subject line of email. Useful for easily filtering email. |
usessl | No | "true" to connect to the smtp server using SSL. Do not forget to set the corresponding mailport. |
Child Elements
Element | Cardinality | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<always> |
0 .. * | Mail address to be emailed notification after all builds.
<always> has the following attributes:
|
||||||||||||||||||||||||
<failure> |
0 .. * | Mail address to be emailed notification after failed builds.
<failure> has the following attributes:
|
||||||||||||||||||||||||
<ignore> |
0 .. * | User name to be removed from the user list, thus not sent any email.
Useful for removing the fake user names created by some sourcecontrols.
<ignore> has the following attributes:
|
||||||||||||||||||||||||
<success> |
0 .. * | Mail address to be emailed notification after successful builds.
<success> has the following attributes:
|
||||||||||||||||||||||||
<alert> |
0 .. * | Mail address to be emailed notification if any of the build's
modified files match the supplied regular expression.
<alert> has the following attributes:
|
||||||||||||||||||||||||
<map> |
0 .. * | Maps a source control user id to an email address.
<map> has the following attributes:
|
||||||||||||||||||||||||
<propertiesmapper> |
0 .. * | map source control user names to either valid email names
or complete email addresses. <propertiesmapper>
has the following attributes:
|
||||||||||||||||||||||||
<ldapmapper> |
0 .. * | map source control user names to either valid email names
or complete email addresses. <ldapmapper>
has the following attributes:
|
<htmlemail>
<cruisecontrol> <project> <publishers> <htmlemail>
Sends an email with the build results embedded as HTML. By default the same information as the JSP build results page is sent.
Typical usage is to define xsldir and css to point to cruisecontrol locations. This publisher creates HTML email by transforming information based on a set of internally pre-defined xsl files. (Currently "header.xsl", and "buildresults.xsl") This list can be changed, or appended to, using xslfilelist attribute. Alternatively, you can specify a single xsl file to handle the full transformation using the xslfile attribute.
Attributes
All of the attributes and child elements of <email>
apply to <htmlemail>
as well. The following table
specifies the additional or changed attributes.
Attribute | Required | Description |
---|---|---|
buildresultsurl | No | Email will include link to the build results JSP if this URL is provided. |
charset | No | If not set the content type will be set to 'text/html'. If set the content type will be 'text/html;charset="value"'. |
css | versions up to 2.3: unless xslfile specified versions 2.3 and greater: no |
Path to cruisecontrol.css. Used only if xsldir set and not xslfile. Starting with version 2.3, the HTMLEmailPublisher will try to determine the correct value itself when it's not specified and xslfile isn't used. |
logdir | No (Yes for versions < 2.2) | Path to the log directory as set in the log element of the configuration xml file. Follows default of log's dir-attribute since version 2.2 |
xsldir | versions up to 2.3: unless xslfile specified versions 2.3 and greater: no |
Directory where standard CruiseControl xsl files are located. Starting with version 2.3, the HTMLEmailPublisher will try to determine the correct value itself when it's not specified and xslfile isn't used. |
xslfile | No | If specified, xsldir, xslfilelist, and css are ignored. Must handle the entire document. |
xslfilelist | No | Works with xsldir and css. String, representing ordered list of xsl files located in xsldir, which are used to format HTML email. List is comma or space separated. If first character of list is plus sign ("+"), the listed file(s) are added to existing set of xsl files used by HTMLEmailPublisher. If xslfilelist is not specified, email is published using hard-coded list of xsl files. |
Child Elements
Element | Cardinality | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
<parameter> |
0 .. * | Parameters passed to the XSL files before transforming them to HTML. Check
the Reporting application's
documentation for parameters used in the standard XSL files.
<parameter/> has the following attributes:
|
<jabber>
<cruisecontrol> <project> <publishers> <jabber>
Sends an instant message with a link to the build results via a Jabber server using XMPP.
Attributes
Attribute | Required | Description |
---|---|---|
host | Yes | The host of the Jabber server. |
port | No | Port of the Jabber server. Defaults to 5222. Note: SSL typically runs on port 5223. |
username | Yes | Username of the account used to send the instant message. For individuals, this is typically of the form 'foo' as opposed to '[email protected]' |
password | Yes | Password of the sender account |
recipient | Yes | Username of the recipient of the instant message. Recipient username is typically fully qualified: [email protected] |
chatroom | No | Whether the recipient is a group/chat (true) versus an individual (false). Defaults to false. |
ssl | No | Whether the XMPP connection on host:port is using SSL. |
buildresultsurl | Yes | Email will include link to the build results. |
service | No | Service to use. |
<onfailure>
<cruisecontrol> <project> <publishers> <onfailure>
Provides the means to execute another publisher (or set of publishers) if and only if the current build has failed. This is accomplished by simply adding any desired publishers as child elements.
All child elements must meet the following criteria:
- They must be registered as publishers. If you are adding a publisher which ships with CruiseControl, this will be done for you automatically. If you are adding a custom publisher, you must remember to register it with CruiseControl using a <plugin> element within your config file.
- They must validate successfully regardless of whether or not the build was successful.
Child Elements
Element | Cardinality | Description |
---|---|---|
Any defined publisher | 1 .. * | You may use any defined publisher as a child element. |
Examples
- After a failed build, use the x10 publisher to light up a lamp,
and call an Ant script to do some cleanup.
<onfailure> <x10 houseCode="A" deviceCode="3"/> <antpublisher antscript="/opt/apache-ant-1.6.1/bin/ant" target="cleanupafterfailure"> </antpublisher> </onfailure>
<onsuccess>
<cruisecontrol> <project> <publishers> <onsuccess>
Provides the means to execute another publisher (or set of publishers) if and only if the current build was successful. This is accomplished by simply adding any desired publishers as child elements.
All child elements must meet the following criteria:
- They must be registered as publishers. If you are adding a publisher which ships with CruiseControl, this will be done for you automatically. If you are adding a custom publisher, you must remember to register it with CruiseControl using a <plugin> element within your config file.
- They must validate successfully regardless of whether or not the build was successful.
Child Elements
Element | Cardinality | Description |
---|---|---|
Any defined publisher | 1 .. * | You may use any defined publisher as a child element. |
Examples
- After a successful build, use the x10 publisher to light up a lamp,
and run the artifacts publisher to save the build artifacts.
<onsuccess> <x10 houseCode="A" deviceCode="7"/> <artifactspublisher dir="checkout/project1/dist" dest="artifacts/project1"> </artifactspublisher> </onsuccess>
<rss>
Publishes an Really Simple Syndication (RSS) feed of build results. Multiple CruiseControl projects can publish into the same RSS feed provided that the "file" attribute point to the same location.
Attributes
Attribute | Required | Description |
---|---|---|
buildresultsurl | yes | RSS item will include a link to the build results page. Build results URL should look like 'http://MACHINENAME/cruisecontrol/buildresults/PROJECTNAME'. |
channellinkurl | No | The primary URL associated with the RSS feed. |
file | Yes | The location to which the RSS file should be published. If an RSS file already exists in this location, existing RSS attributes (title, description, channel link URL, news items) will be preserved. |
maxlength | No | The maximum number of items to maintain in the RSS file. Defaults to 10. |
<sametimeannouncement>
<cruisecontrol> <project> <publishers> <sametimeannouncement>
A publisher that sends Sametime announcements (optionally with a URL
to the build results JSP) with the overall result of the build. Almost
all of the attributes of <email>
apply to <sametimeannouncement>
as well.
Attributes
Attribute | Required | Description |
---|---|---|
buildresultsurl | No | URL to include with the build results. |
host | Yes | Synonym for mailHost. |
username | Yes | User name to login to the Sametime community. |
password | No | Password used to login to the Sametime community. If not specified, an anonymous login (using username) will be attempted. |
community | No | Sametime community to login to. Default is null — appropriate for single community servers. |
resolveusers | No (defaults to true) | Whether addresses should be resolved as users. |
resolvegroups | No (defaults to true) | Whether addresses should be resolved as groups. |
usegroupcontent | No (defaults to true) | Whether to send announcements to the content (members) of a group instead of the group directly. |
handleresolveconflicts | No (defaults to recipient) | How to handle address resolution conflicts. Valid values:
|
handleresolvefails | No (defaults to error) | How to handle address resolution failures. Valid values:
|
handlequerygroupcontentfails | No (defaults to error) | How to handle group content query failures. Valid values:
|
<socket>
<cruisecontrol> <project> <publishers> <socket>
Simply writes "Success" or "Failure", followed by the project name, to a socket. Note that you will need to write a socket listener that does something.
Attributes
Attribute | Required | Description |
---|---|---|
socketServer | Yes | Hostname (i.e., first argument for constructing a Java socket) |
port | Yes | Port number for the listening socket |
sendProjectName | No (defaults to true) | Whether the project name should be appended to the result string. |
sendFixed | No (defaults to false) | Whether the publisher should send "Fixed" instead of "Success" after "Failure". |
<weblog>
<cruisecontrol> <project> <publishers> <weblog>
Posts the build results to a weblog using the Blogger API, the MetaWeblog API or the LiveJournal API.
Examples
<!-- Post the build results to your project blog under the category 'cruisecontrol' using the Blogger API. --> <weblog api="blogger" blogurl="http://blogserver/blog/xmlrpc" blogid="blog" username="lasse" password="secret" category="cruisecontrol" reportsuccess="fixes" subjectprefix="[CC]" buildresultsurl="http://buildserver/cruisecontrol/myproject" logdir="/var/cruisecontrol/logs/myproject" xsldir="/opt/cruisecontrol/reporting/jsp/xsl" css="/opt/cruisecontrol/reporting/css/cruisecontrol.css"/>
<!-- Post the build results to your project blog under the category 'cruisecontrol' using the MetaWeblog API. --> <weblog api="metaweblog" blogurl="http://blogserver/blog/xmlrpc" blogid="blog" username="lasse" password="secret" category="cruisecontrol,java" reportsuccess="fixes" subjectprefix="[CC]" buildresultsurl="http://buildserver/cruisecontrol/myproject" logdir="/var/cruisecontrol/logs/myproject" xsldir="/opt/cruisecontrol/reporting/jsp/xsl" css="/opt/cruisecontrol/reporting/css/cruisecontrol.css"/>
<!-- Post the build results to your project blog under the category 'cruisecontrol' using the LiveJournal API. --> <weblog api="metaweblog" blogurl="http://www.livejournal.com/interface/xmlrpc" blogid="blog" username="lasse" password="secret" category="cruisecontrol" reportsuccess="fixes" subjectprefix="[CC]" buildresultsurl="http://buildserver/cruisecontrol/myproject" logdir="/var/cruisecontrol/logs/myproject" xsldir="/opt/cruisecontrol/reporting/jsp/xsl" css="/opt/cruisecontrol/reporting/css/cruisecontrol.css"/>
Attributes
Attribute | Required | Description |
---|---|---|
api | No | The API to use for posting to the blog. Accepted values include blogger and metaWeblog. Defaults to metaWeblog. |
blogurl | Yes | The URL where your blog receives XML-RPC requests. |
blogid | Yes | The "identifier" for your blog. See your blog's documentation for the correct value. |
username | Yes | The username for authentication. |
password | Yes | The password for authentication. |
logdir | Yes | The CruiseControl log directory. |
xslfile | Yes, unless xsldir is used. | The XSL stylesheet used for transforming the build results into the message being posted to the blog. |
xsldir | Yes, unless xslfile is used. | The directory containing the XSL stylesheets used for transforming the build results into the message being posted to the blog. You can use the CruiseControl distribution's XSL directory, "${CC_HOME}/reporting/jsp/xsl", or use your custom stylesheets. |
css | Yes, if xsldir is used. | The path to cruisecontrol.css to be used for styling the generated HTML. You can use the CruiseControl distribution's 'cruisecontrol.css' file from "${CC_HOME}/reporting/jsp/css" or use a custom stylesheet. |
buildresultsurl | No | The base URL for the CruiseControl reporting web application. Usually of the form "http://buildserver/cruisecontrol/<projectname>". If this URL is provided, the resulting blog entry will include a link to the build results. |
category | No | The category to which the blog entries should be added. For the Blogger API, only one category name is allowed. For the MetaWeblog API, a comma-separated list of category names is also possible. |
reportsuccess | No | The rule for reporting successful builds. Accepted values are "always", "never", and "fixes" (only post the results for the first successful build after a failed one). |
subjectprefix | No | The prefix to use for blog entries' title. |
<x10>
This Publisher implementation sends a on/off signal to a X10 capable device via an X10 computer interface, model CM11A or CM17A. This allows you to control an electronic device when the build breaks. For example, use a flashing red light to indicate a broken build.
Quick Start
- Buy the home automation kit found at http://www.x10.com/automation/x10_ck11a_1.htm.
- Plug the computer interface to your serial port (for example, COM1 or /dev/ttyS0), and your powerline
- Set the lamp module's house and device code such as A3 and plug it into your powerline.
- Plug in an electronic device to the lamp module like a lava lamp or flashing red light found at http://www.bwild.com/redsiren.html.
- Install the Java Communications API on your
CruiseControl machine. On Windows, copy win32com.dll from
the CruiseControl lib directory to
your
JAVA_HOME/bin
directory. On Linux, first obtain the Linux zip file from http://www.sun.com/download/products.xml?id=43208d3d. At the time of this writing, the name of the file wascomm3.0_u1_linux.zip
. Extractcommapi/jar/comm.jar
andcommapi/docs/javax.comm.properties
into the CruiseControl lib directory, overwriting the existingcomm.jar
file. - Add the x10 publisher to CruiseControl's config.xml.
For example, on Windows:
On Linux:<x10 houseCode="A" deviceCode="3" port="COM1" />
<x10 houseCode="A" deviceCode="1" interfaceModel="cm17a" port="/dev/ttyS0" />
For more information about the CM11A controller, see http://www.smarthome.com/1140.html or http://www.x10.com/automation/x10_ck11a_1.htm. The controller connects to the computer via a serial port, e.g. COM1, and allows the computer to send (and receive) X10 signals on the power line. For more information on X10 in general, see http://www.x10.com/support/basicx10.htm.
This module uses a pure Java implementation of the CM11A and CM17A communication protocol as implemented by Jesse Peterson, http://www.jpeterson.com/. To read more about his library, see http://www.jpeterson.com/rnd/x101.0.1/Readme.html.
The jpeterson library requires that the Java Communications API be
installed. For more information on the COMM API, see http://java.sun.com/products/javacomm/index.jsp.
For convenience, the Java COMM API is included with the CruiseControl
distribution. On windows, copy the win32com.dll from CruiseControl's
lib directory to your JAVA_HOME/bin
directory.
NOTE: If you receive the following error:
Error loading win32com: java.lang.UnsatisfiedLinkError: no
win32com in java.library.path
it probably means that the Windows DLL named win32com.dll needs to be copied from CruiseControl's lib directory into your JDK (or JRE) bin directory (that is, the same directory that java.exe is found).
If you don't know what interface your device uses, try the default. If the publisher hangs, try a different value for the interfaceModel parameter.
The standard behavior for this publisher is to send the device the "on" signal when the build breaks and then the "off" signal when the build is successful. If you want the opposite, i.e. on when successful and off when broken, set the onWhenBroken attribute to false.
Attributes
Attribute | Required | Description |
---|---|---|
houseCode | Yes | The house code for the device to control, A through P case insensitive |
deviceCode | Yes | The device code for the device to control, 1 -> 16 |
port | No (defaults to COM2) | Serial port to which the computer interface controller is connected, e.g. COM1 |
onWhenBroken | No (defaults to true) | Set to false if the device should turn on when the build is successful and off when failed |
interfaceModel | No (defaults to CM11A) | Model number for the computer interface controller being used, either CM11A or CM17A (case insensitive). |
Examples
<!--Turn on X10 device(s) A3 using a CM11A computer interface on COM2 whenever the build breaks.--> <x10 houseCode="A" deviceCode="3"/>
<!--Turn on X10 device(s) P12 using a CM11A computer interface on COM2 whenever the build breaks.--> <x10 houseCode="P" deviceCode="12"/>
<!--Turn on X10 device(s) A3 using a CM11A computer interface on COM1 whenever the build breaks.--> <x10 houseCode="A" deviceCode="3" port="COM1"/>
<!--Turn on X10 device(s) A3 using a CM11A computer interface on COM1 whenever the build is successful.--> <x10 houseCode="A" deviceCode="3" port="COM1" onWhenBroken="false"/>
<!--Same as the previous, only explicitly indicating which X10 computer interface is being used.--> <x10 houseCode="A" deviceCode="3" port="COM1" onWhenBroken="false" interfaceModel="CM11A"/>
<!--Turn on X10 device(s) A3 using a CM17A computer interface on COM1 whenever the build is successful.--> <x10 houseCode="A" deviceCode="3" port="COM1" onWhenBroken="false" interfaceModel="CM17A"/>
<xsltlogpublisher>
<cruisecontrol> <project> <publishers> <xsltlogpublisher>
Performs an transformation of the log file. The obvious use is to generate HTML files to a website, but could be used to generate other sorts of output files as well.
Attributes
Attribute | Required | Description |
---|---|---|
directory | Yes | Directory for output file |
outfilename | No | Name for the output file. Default uses the build label, 'label.log' |
publishonfail | No (defaults to true) | Deprecated. Use <onsuccess> and
<onfailure> instead. Generate file if the build failed? |
xsltfile | Yes | XSL file to used for the transform. |
<yahoopublisher>
<cruisecontrol> <project> <publishers> <yahoopublisher>
Sends an instant message with a link to the build results via a Yahoo IM message. You need to put the files ymsg_network_v0_6.jar and ymsg_support_v0_6.jar into the library path of CC. These can be downloaded at http://jymsg9.sourceforge.net/.
Attributes
Attribute | Required | Description |
---|---|---|
username | Yes | Username of the account used to send the instant message. For individuals, this is typically of the form 'foo' as opposed to '[email protected]' |
password | Yes | Password of the sender account |
recipient | Yes | Username of the recipient of the instant message. Recipient username is typically of the form 'foo' as opposed to '[email protected]' |
buildresultsurl | Yes | Email will include link to the build results. |
proxyHost | No | HTTP proxy to use. |
proxyPort | No | HTTP proxy port to use. |
<dateformat>
<cruisecontrol> <project> <dateformat>
The optional <dateformat>
element overrides the
default date format for presentation. If this element is not specified,
the default date format is "MM/dd/yyyy HH:mm:ss
".
Attributes
Attribute | Required | Description |
---|---|---|
format | Yes | A DateFormat String that specifies the date format for presentation. |
<plugin>
<cruisecontrol> <plugin> <project> <plugin>
A <plugin>
element registers a classname with an
alias for use within the configuration file.
Plugins can also be pre-configured at registration time. This can greatly reduce the configuration file size.
The plugins page contains a discussion of the plugin architecture used with CruiseControl.
Attributes
Attribute | Required | Description |
---|---|---|
name | Yes | The alias used to refer to the plugin elsewhere in the configuration file. |
classname | Yes | The class that implements the plugin. |
<labelincrementer>
<cruisecontrol> <project> <labelincrementer>
Handle incrementing the label used to tag each build.
Attributes
The following attributes are valid for the default label incrementer. If the label incrementer plugin is overridden, other attributes may be applicable.
Attribute | Required | Description |
---|---|---|
defaultLabel | No (default to "build.1") | set label to use if there is no saved label. |
preBuildIncrementer | No (defaults to false) | if true the build number will be incremented
prior to the build attempt and thus each build attempt will have
a unique build number. |
separator | No (defaults to period '.' ) |
specifies the separator to use between label and build count. |
Overriding the Default Label Incrementer
If this element is not specified, the default label incrementer will
use the format string.number
, providing the default label of
build.1
.
To override the label incrementer used in a given project all you
need to do is register a different class as a plugin
with the name labelincrementer
. Alternate label incrementer plugins distributed with
CruiseControl include:
CVSLabelIncrementer
An extension of the default label incrementer but with the separator set to "-" by default. Provides default label of "build-1".
<plugin name="labelincrementer" classname="net.sourceforge.cruisecontrol.labelincrementers.CVSLabelIncrementer"/>
EmptyLabelIncrementer
Always returns a label of "" (empty string).
<plugin name="labelincrementer" classname="net.sourceforge.cruisecontrol.labelincrementers.EmptyLabelIncrementer"/>
FormattedLabelIncrementer
A label incrementer for creating consistent, formatted upper case labels. This plugin expects the label format to be either "x_y_z" or "y_z" where x is any String, y is an integer and z is one of REL, INT or BLD, i.e. MYPROJ_1_INT or 1_REL.
<plugin name="labelincrementer" classname="net.sourceforge.cruisecontrol.labelincrementers.FormattedLabelIncrementer"/>
P4ChangelistLabelIncrementer
Creates a label from either a given Perforce changelist number, or the most recently submitted changelist. A changelist number can be a good choice for labeling builds from Perforce, because a changelist indicates a particular state of the depot at a moment of time which will never change. This class also has features for cleaning up and synchronizing the local client. This incrementer will always run before the build executes.
Even though the Perforce Bootstrapper
handles synchronizing, this will execute before the p4
modification check runs. Putting the synchronization after
the modification check saves us a bit of time by only requesting
the server's files when needed. This feature can be turned off
by setting the attribute noSync
to true
.
By default, the class will use to the most currently submitted
changelist as the label. If you wish to use a specific changelist
number (say, for rerunning an old build), you can set the
changelist
attribute to the desired number. Whichever
of these is chosen, the synchronize step (if enabled) will sync
to this changelist number.
A good habit of build environments entails ensuring that the local
environment comes only from the source control system, meaning that
files haven't been modified without the source control system's
knowledge, and that other files haven't been added. To support that,
this class can delete the directories under Perforce view by
setting the attribute delete
to true
.
This will force the local clients to be removed first (ala
sync view#0
), and after deleting the files will
perform the above synchronize.
Removing the local client files (sync #0) can be done without
deleting the files by setting the clean
attribute
to true
.
Attributes
<plugin name="labelincrementer" classname="net.sourceforge.cruisecontrol.labelincrementers.P4ChangelistLabelIncrementer"/>
Attribute | Required | Description |
---|---|---|
changelist | No | set the changelist number to sync to. Not specifying this value will sync to the most recently committed changelist. |
port | Yes | Perforce Server connection to use (host:port) |
client | Yes | Perforce Client name to use |
user | Yes | Perforce User name to use |
passwd | No | Perforce password to use |
view | Yes | Valid Perforce view (i.e. a depot path) |
separator | No (defaults to period '.' ) |
specifies the separator to use between label and build count. |
noSync | No (defaults to false ) |
enable to turn off synchronizing the depot to the label (changelist) number. |
clean | No (defaults to false ) |
syncs the view to revision 0, which removes the current files from the local hard drive and also tells the server that the client no longer has those files. Enabling this will also force the noSync to be false. |
delete | No (defaults to false ) |
deletes any remaining files from the view that the clean step missed. Enabling this will also force the clean to occur, and the noSync to be false. |
PropertyFileLabelIncrementer
Returns a value for the label from a property file.
Attributes
<plugin name="labelincrementer" classname="net.sourceforge.cruisecontrol.labelincrementers.PropertyFileLabelIncrementer"/>
Attribute | Required | Description |
---|---|---|
defaultlabel | No | value to return if property file doesn't exist. if not specified and file doesn't exist an exception is thrown. |
propertyfile | Yes | the property file to read. |
propertyname | Yes | the name of the property to read for the value of the label. |
<currentbuildstatusftppublisher>
<cruisecontrol> <project> <publishers> <currentbuildstatusftppublisher>
Note: this plugin has been made obsolete by the
currentbuildstatusftplistener
.
This performs the same action as
<currentbuildstatuspublisher>
,
except that the status file is sent to the remote site via FTP, instead
of being stored locally.
Attributes
In addition to the common FTP attributes,
<currentbuildstatusbootstrapper>
uses the following
attributes.
Attribute | Required | Description |
---|---|---|
file | Yes | The filename to write. |
destDir | Yes | The remote directory (relative to targetDir ) to write the file. |
<ftppublisher>
<cruisecontrol> <project> <publishers> <ftppublisher>
Copies the XML log file from the build, and all files published by
<artifactspublisher>
,
onto the FTP server. To publish the artifacts, the
<artifactspublisher>
element must occur before this
publisher in the configuration file.
Attributes
In addition to the common FTP attributes,
<currentbuildstatusbootstrapper>
uses the following
attributes.
Attribute | Required | Description |
---|---|---|
destDir | Yes | The remote directory (relative to targetDir )
to publish the files. |
srcDir | Yes | To publish the XML log file, this must be the same as the dir attribute of the
<log> element. To publish
the artifacts, this must be the same as the
<artifactspublisher>
directory. |
deleteArtifacts | No (defaults to false) | If true , then all files successfully sent to
the FTP server will be deleted locally. |
Common FTP Attributes
The following attributes are common to the
<currentbuildstatusftpbootstrapper>
,
<currentbuildstatusftppublisher>
and the
<ftppublisher>
.
Attribute | Required | Description |
---|---|---|
targetHost | Yes | Host name of the FTP server. |
targetUser | No (defaults to anonymous ) |
The user used for logging into the FTP site. |
targetPasswd | No (default to [email protected] ) |
The password used during FTP log in for the
targetUser . |
targetPort | No (defaults to 21) | Port number of the FTP server. |
targetDir | No (defaults to '.' ) |
Base directory in the FTP server to put the files. |
targetSeparator | No (defaults to '/ '. |
Directory separator character used by the FTP server. |
XPath Aware Child Attributes
The following attributes are common to the xpath aware children found in
<sfeetracker>
and
<sfeedocman>
.
Attribute | Required | Description |
---|---|---|
value | One of value or xpathExpression must be specified. |
A fixed value that will not change at runtime. |
xpathExpression | One of value or xpathExpression must be specified. |
An xpath expression to evaluate against the CruiseControl log file, or the xml file
as specified by xmlFile attribute. The result of the expression will be
used as the value. |
xmlFile | No (defaults to the CruiseControl build log). | Path to a file on the local filesystem against which the
xpathExpression will be evaluated. |
Named XPath Aware Child Attributes
The same attributes as found in the XPath Aware Child Attributes and one additional attribute to specify a name.
Attribute | Required | Description |
---|---|---|
name | Yes | The name of a field in the tracker artifact. |