Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
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

 Image RemovedImage Added


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).



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 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.

Table of Contents
minLevel3

...

  •  

...

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 

...

NameDescriptionTypeUsage Example
NameThe stage name as defined within the workflow editorString$Build.Stage.Name"this is a test stage"
MetricsA reference object to the metrics associated with this build (as defined below).Metrics$Build.Stage.MetricsN/A

...

...

$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

...

Boolean Functions

...

DateTime Properties and Functions

...

Date Properties and Functions

...

DateTime Properties and Functions

...

TimeSpan Properties and Functions

...