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.
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
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).
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.
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.
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.
Expandable fields on the Variables and Artifacts tabs for Build Completed triggers, support the following root expression objects.
The Version Format field on the Stages step of the configuration wizard, supports the following root expression objects.
Expandable fields on the Edit Variable dialog (for variable types other than Expression) , support the following root expression objects.
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.
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.
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.
Expandable fields on the Edit Report dialog, support the following root expression objects.
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Branch | The full name of the branch associated with the build for the given repository | String | $Source.RepoName.Branch$ | "/branches/a_test_branch" |
BranchName | The branch name of the branch associated with the build for the given repository | String | $Source.RepoName.BranchName$ | "a_test_branch" |
BuiltChangeset | A reference object to the changeset information related to the changeset which is being built for the given repository (as defined below) | Changeset | $Source.RepoName.BuildChangeset.TagNames$ | "tag1,tag2,tag3" |
CommitsSinceLatestTag | The number of commits listed in the changeset history for the current branch of the given repository since the latest tag | Integer | $Source.RepoName.CommitsSinceLatestTag$ | 3 |
LatestChangeset | A reference object to the changeset information related to the most recent changeset for the given repository (as defined below). | Changeset | $Source.RepoName.LatestChangeset.Comment$ | "a comment from the last commit" |
LatestTagName | The latest tag name (if one exists) listed in the changeset history for the current branch of the given repository | String | $Source.RepoName.LatestTagName$ | "tag3" |
LatestTriggeringChangeset | A reference object to the changeset information related to the latest changeset for the given repository which triggerred this build (as defined below) | Changeset | $Source.RepoName.BuildChangeset.BranchName$ | "master" |
Path | The disk location of the source associated with the build for the given repository | String | $Source.RepoName.Path$ | "C:\ContinuaAgent\Ws\44\Source\" |
Tag | The tag name (if one exists) associated with the build for the given repository | String | $Source.RepoName.Tag$ | "v3-release" |
Type | The repository product being used | String | $Source.RepoName.Type$ | "Mercurial" |
Url | The URL of the repository in question (as defined within the repository preferences) | String | $Source.RepoName.Url$ | "https://github.com/VSoftTechnologies/Delphi-Mocks.git" |
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Id | A unique identifier given to this changeset | String | $Source.RepoName.BuiltChangeset.Id$ | "a4ae66dffe5342e47c3aaf987bced4e9a320559e" |
Comment | This comment associated with this changeset | String | $Source.RepoName.BuiltChangeset.Comment$ | "This is a test commit" |
RepositoryUsername | The username of the repository user who committed this changeset | String | $Source.RepoName.BuiltChangeset.RepositoryUsername$ | "Peter Toms" |
Branch | The full branch path of the latest changeset associated with this repository | String | $Source.RepoName.BuiltChangeset.Branch$ | "/branches/a_test_branch" |
BranchName | The branch name of the latest changeset associated with this repository | String | $Source.RepoName.BuiltChangeset.BranchName$ | "a_test_branch" |
Created | The date and time when the changeset was committed or created within the source repository | DateTime | $Source.RepoName.BuiltChangeset.Created$ | "11/09/2014 1:48:36 AM" |
FileCount | The number of file changes associated with this commit | Integer | $Source.RepoName.BuiltChangeset.FileCount$ | 1 |
CommitterUserName | The username of the Continua User who committed this changeset (if one exists based on user repository mappings ) | String | $Source.RepoName.BuiltChangeset.CommitterUserName$ | "peter.toms@finalbuilder.com" |
CommitterFullName | The full name of the Continua user who committed this changeset (if one exists based on user repository mappings) | String | $Source.RepoName.BuiltChangeset.CommitterFullName$ | "Peter Toms" |
FirstTagName | The name of the first (or earliest) tag associated with this changeset | String | $Source.RepoName.BuiltChangeset.FirstTagName$ | "tag1" |
LatestTagName | The name of the latest tag associated with this changeset | String | $Source.RepoName.BuiltChangeset.LatestTagName$ | "tag3" |
TagNames | A comma-delimited list of tags associated with this changeset | String | $Source.RepoName.BuiltChangeset.TagNames$ | "tag1,tag2,tag3" |
ChangedTagName | The name of the tag which was changed by this changeset | String | $Source.RepoName.LatestTriggeringChangeset.ChangedTagName$ | "tag3" |
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 |
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Compiler.Warning | The total number of compiler warnings for the current build (eg MSBuild or Visual Studio build warnings) | Integer | $Build.Metrics.Compiler.Warning$ | 5 |
Compiler.Error | The total number of compiler errors for the current build (eg MSBuild or Visual Studio build errors) | Integer | $Build.Metrics.Compiler.Error$ | 5 |
UnitTests | A reference object for the unit test metric details (as defined below) | UnitTests | $Build.Metrics.UnitTests | N/A |
Name | Description | Type | Usage Example | |
---|---|---|---|---|
FixtureCount | The total number of test fixtures | Integer | $Build.Metrics.UnitTests.FixtureCount$ | 5 |
CaseCount | The total number of test cases | Integer | $Build.Metrics.UnitTests.CaseCount$ | 5 |
Passed | The number of passed tests | Integer | $Build.Metrics.UnitTests.Passed$ | 10 |
Failed | The number of failed tests | Integer | $Build.Metrics.UnitTests.Failed$ | 5 |
Error | The number of tests in error | Integer | $Build.Metrics.UnitTests.Error$ | 1 |
NotRun | The number of tests not run | Integer | $Build.Metrics.UnitTests.NotRun$ | 1 |
Inconclusive | The number of inconclusive tests | Integer | $Build.Metrics.UnitTests.Inconclusive$ | 1 |
Ignored | The number of ignored tests | Integer | $Build.Metrics.UnitTests.Ignored$ | 1 |
Invalid | The number of invalid tests | Integer | $Build.Metrics.UnitTests.Invalid$ | 1 |
Skipped | The number of skipped tests | Integer | $Build.Metrics.UnitTests.Skipped$ | 1 |
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Default | A reference object for the default version | Default | $Build.Version.Default | N/A |
DotNet | A reference object for the .Net version | DotNet | $Build.Version.DotNet | N/A |
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Major | The version major portion of the version number | Integer | $Build.Version.Default.Major$ | "1" (given "1.2.3.4") |
Minor | The version minor portion of the version number | Integer | $Build.Version.Default.Minor$ | "2" (given "1.2.3.4") |
Build | The version build portion of the version number | Integer | $Build.Version.Default.Build$ | "3" (given "1.2.3.4") |
Revision | The version revision portion of the version number | Integer | $Build.Version.Default.Revision$ | "4" (given "1.2.3.4") |
Name | Description | Type | Usage Example | |
---|---|---|---|---|
Major | The version major portion of the version number | Integer | $Build.Version.DotNet.Major$ | "1" (given "1.2.0.1287") |
Minor | The version minor portion of the version number | Integer | $Build.Version.DotNet.Minor$ | "2" (given "1.2.0.1287") |
Build | The version build portion of the version number | Integer | $Build.Version.DotNet.Build$ | "0" (given "1.2.0.1287") |
Revision | The version revision portion of the version number | Integer | $Build.Version.DotNet.Revision$ | "1287" (given "1.2.0.1287") |