Rake Task

Executes Rake.


Available from version 1.4


Minimalist example

1<rake />

Full example

 2  <executable>c:\ruby\bin\rake.bat</executable>
 3  <baseDirectory>c:\fromcvs\myrepo\myproject</baseDirectory>
 4  <buildArgs>additional-argument</buildArgs>
 5  <rakefile>Rakefile</rakefile>
 6  <targetList>
 7    <target>build</target>
 8  </targetList>
 9  <buildTimeoutSeconds>1200</buildTimeoutSeconds>
10  <quiet>false</quiet>
11  <silent>false</silent>
12  <trace>true</trace>

Configuration Elements

Element Description Type Required Default Version
baseDirectory The directory to run the Rake process in. If relative, is a subdirectory of the Project Working Directory. String No Project Working Directory 1.4
buildArgs Any arguments to pass through to Rake (e.g to specify build properties). String No None 1.4
buildTimeoutSeconds Number of seconds to wait before assuming that the process has hung and should be killed. Int32 No 600 1.4
description Description used for the visualisation of the buildstage, if left empty the process name will be shown. String No The task/publisher name. 1.5
dynamicValues The dynamic values to use for the task. Dynamic Values array No None 1.5
environment A set of environment variables set for commands that are executed.
Each variable should be specified as
1<variable name="name" value="value" />

Environment Variable array No
executable The path of the version of Rake you want to run. If this is relative, then must be relative to either (a) the base directory, (b) the CCNet Server application, or (c) if the path doesn't contain any directory details then can be available in the system or application's 'path' environment variable. String No c:\ruby\bin\rake.bat 1.4
priority The priority class of the spawned process. String - one of:
* Normal
* Idle
* High
* RealTime
* BelowNormal
* AboveNormal
No Normal 1.5
quiet Do not log messages to standard output. Boolean No false 1.4
rakefile The name of the Rakefile to run, relative to the baseDirectory.
If no rake file is specified Rake will use the default build file in the working directory.
String No None 1.4
silent Like quiet but also suppresses the 'in directory' announcement. Boolean No false 1.4
targetList A list of targets to be called. CruiseControl.NET does not call Rake once for each target, it uses the Rake feature of being able to specify multiple targets.
If no targets are defined Rake will use the default target.
String array No None 1.4
trace Turns on invoke/execute tracing and enables full backtrace. Boolean No false 1.4


Accessing CruiseControl.NET build labels in Rake

CCNet will pass the current build label to Rake via the environment variable CCNetLabel. This means that you can access this variable too. For example, archive the build results in a folder with the same name as the build label (this is what we do on CCNetLive using NAnt. Here's some example Rakefile demonstrating how to do this:

 1            #!ruby
 2            require 'rake'
 4            task :default => [:deploy]
 6            task :deploy do
 7                publishdir="C:/download-area/CCNet-Builds/#{ENV['CCNetLabel']}" 
 8                mkdir_p publishdir
 9                FileList['dist/*'].each do |file|
10                    cp file, publishdir
11                end
12            end

See Integration Properties for the values that are passed to the task.

Automatically Generated

Documentation generated on Monday, 26 May 2014 at 7:18:04 AM