Version 8 (modified by hans, 7 years ago) (diff)


Integrating CruiseControl with Phing

CruiseControl is a continuous integration tool written in Java -- and tightly integrated with Ant by default. This document describes how you can also use CruiseControl to invoke Phing build scripts. The Phing builder plugin and these instructions are both a work in progress. Please report bugs you find with either using the ticket tracker.


The Phing Builder Plugin

There is a Phing plugin for CruiseControl, which is derived from the Ant plugin. The Phing builder plugin is distributed with CruiseControl in 3.6.2 (see; however, if you have an older version of CruiseControl you can install & configure this plugin manually.


To install the plugin, simply download it and place it in your cruisecontrol/main/lib/ directory, or some other location that you know will be on your CLASSPATH when you run CruiseControl.

Using the Builder Plugin

Here is a sample CruiseControl config.xml that calls a Phing build file.

<cruisecontrol buildafterfailed="true">

        <plugin name="phing" classname=""/>

        <project name="myproject">

                        <svn localworkingcopy="checkout/myproject-trunk"/>

                <schedule interval="60">

                <log dir="logs/myproject-trunk"/>

                <currentbuildstatuslistener file="logs/myproject-trunk/buildstatus.txt"/>



Plugin Reference

This reference is based on the official CruiseControl reference for the Ant plugin.

buildfileNo (defaults to build.xml)Path to Phing build file.
targetNoPhing target(s) to run. Default is "", or the default target for the build file.
multipleNoBuild 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.
timeNoTime in the form HHmm. Can't be set if multiple is set.
dayNoValid 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.
tempfileNoName of temp file. Defaults to log.xml
phingscriptNo (cannot be specified if phinghome attribute is also specifiedAbsolute filename of script (shell script or bat file) used to start Phing. You can use this to make CruiseControl use your own Phing installation. If this is not specified, the PhingBuilder assumes that Phing is installed on your include_path.
phinghomeNo. 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).
phingWorkingDirNoWill invoke phing in the specified directory.
saveLogDirNoIf supplied a copy of the phing log will be saved in the specified directory. Example: saveLogDir="/usr/local/dev/projects/cc/logs"
timeoutNoPhing build will be halted if it continues longer than the specified timeout. Value in seconds.
useloggerNo'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.
loggerclassnameNo (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.
usedebugNoIf 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.
usequietNoIf 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.

Attachments (2)

Download all attachments as: .zip