Info |
---|
Note that the page lists and links to the set of expression objects available as from version 1.9.1 of Continua CI. For the list of expressions available to earlier versions see Expression Objects (1.9 and below). |
What are they?
Expressions are a mechanism for the auto-completion of values which may not be known until build execution time (for example the current build number). They can also be used to autocomplete variables.
Where can I use them?
Expressions can be utilised in several dialog fields throughout Continua (they are especially useful within stage actions, and build event handlers).
The expansion icon (below) denotes fields that have expression capabilities. Note is some areas, such as configuration variables, you can click on this icon to disable expressions
Expression Expansion
To initiate an expansion, simply type the dollar symbol '$' and the expression auto complete will present (note: not all objects are available in all fields).
Table of Contents | ||
---|---|---|
|
...
Name | Description | Type | Usage Example | |
---|---|---|---|---|
N/A | A list of repositories associated with the current configuration | Repository | $Source.Reponame$ | "Mercurial_Test_1" |
...
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Now | The current date and time given as local to the server | DateTime | $Server.Now$ | "01/01/2014 5:03:18 PM" |
NowUtc | The date and time given as UTC | DateTime | $Server.NowUtc$ | "01/01/2014 7:04:01 AM" |
Hostname | The Continua server hostname | String | $Server.Hostname$ | "SERVERMACHINE" |
InstallPath | The Continua server install path | String | $Server.InstallPath$ | "C:\Program Files\VSoft Technologies\ContinuaCI\" |
Url | The web service URL | String | $Server.Url$ | "http:\\SERVERNAME:8080" |
...
Generate a new random integer value
If one parameter is provided it designates a random number in the range of greater than or equal to zero and the number provided will be generated
If two parameters are provided they designate the range for the generated number.
If no parameters are provided a 32-bit integer greater than or equal to zero and less than Int32 max value (2,147,483,647) will be generated.
...
$Utils.RandomNumber("1", "10")$
$Utils.RandomNumber("10")$
$Utils.RandomNumber$
...
5
2
1906529119
...
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Name | The stage name as defined within the workflow editor | String | $Build.Stage.Name | "this is a test stage" |
Metrics | A reference object to the metrics associated with this build (as defined below). | Metrics | $Build.Stage.Metrics | N/A |
...
integer startIndex, string value
...
Available Expression Objects
Different expression objects are available for each expandable field depending on which stage in the build process the expression will be evaluated at, and whether it will be evaluated on the server or an agent.
Agent-side expression objects
Stage Actions, Workspace Rules, and Expression Variables
Expandable fields on Action dialogs, and the Workspace Rules tab of the Stage Options dialog in the Stages step of the configuration wizard, and the Edit Variable dialog in various areas, support the following root expression objects.
Server-side expression objects
Triggers and Repositories
Most expandable fields on the Edit Repository dialog and the Edit Trigger dialog, except for the Variables and Artifacts tabs for Build Completed triggers, support the following root expression objects.
Variables, Conditions and Artifacts for Build Completed Triggers
Expandable fields on the Variables and Artifacts tabs for Build Completed triggers, support the following root expression objects.
Version Format
The Version Format field on the Stages step of the configuration wizard, supports the following root expression objects.
Variables
Expandable fields on the Edit Variable dialog (for variable types other than Expression) , support the following root expression objects.
- Configuration (all properties)
- Project
- Server
- Utils
Configuration Conditions, Build Event Handlers and Agent Conditions
Expandable fields when editing Configuration Conditions in the Conditions step of the configuration wizard, in the Edit Build Event Handlers dialog, and in Agent Conditions on the Agent page under Administration, support the following root expression objects.
Agent Requirements
Expandable fields on the Agent Requirements tab of the Stage Options dialog in the Stages step of the configuration wizard, support the following root expression objects.
Stage Gate, Promote Conditions and Skip Conditions
Expandable fields on the Edit Stage Gate dialog, Promote Conditions and Skip Conditions tabs of the Stage Options dialog in the Stages step of the configuration wizard, support the following root expression objects.
Reports
Expandable fields on the Edit Report dialog, support the following root expression objects.
...
$Build.Version.Trim$
$Build.Version.Trim(".,")$
...
"a b c d" (given " a b c d ")
"a.b.c.d" (given ",a.b.c.d.")
...
Number Functions
...
DateTime Functions
...