Velocity templates are used to customize the content of build notifications. Detailed information about velocity templates can be found at Apache web site. Two variables are defined to help inserting information related to QuickBuild in the build notifications. The first variable is build, which refers to the current build object. From this variable, information such as build version, build status, configuration, build log, revision log can be accessed. JavaDoc of the build class is the definitive guide on what methods or properties can be accessed using this variable. There are a lot of methods defined in this class, you should pay attention to those which start with OGNL: prefix (In QuickBuild, all properties or methods for OGNL expressions can also be used to construct velocity templates). The second variable is system, which refers to the current QuickBuild system. From this variable, information such as calendar, system url can be accessed. From the JavaDoc, you can get the full guide on what methods can be called using this variable.
Other files can be included in the template, as long as they are put
under <QuickBuild installation
directory>/templates. For example, the default body template
for Email notifier contains just one line: #parse
("html_notification.vm"). This line includes and parses content
of the file html_notification.vm in
templates sub directory of QuickBuild installation
directory.
To facilitate writing of your own notification templates, some typical variable references are listed below:
$build.version
$build.successful
$build.failed
$build.url
$build.buildLogUrl
$build.revisionLogUrl
$build.buildLogPath
$build.revisionLogPath
$build.configuration
$build.configuration.url
$build.configuration.logUrl
$build.configuration.logPath
$system.readFileAsHtml("$build.buildLogPath", ".*ERROR.*", 25)
$system.readFileAsHtml("$build.revisionLogPath")