What are they?
Expressions are mechanism for the autocompletion of variables whose values may not be known until build execution time. They can also be used to autocomplete build variables (defined within the variables tag of the configuration).
Where can I use them?
Expressions can be utilised in several dialogue fields throughout Continua (they especially useful within stage actions, and build event handlers).
The expansion icon (below) denotes fields that can provide query expansion capabilities.
Expression Expansion
To initiate a query simply type the dollar sign '$' and the query expansion auto complete will present.
When you see an expansion box (with a green tick), this denotes that this field supports query expressions (note; not all queries are available in all fields).
$Workspace
Name | Description | Type | Example |
---|
| The disk location on the server for the build workspace | string | $Workspace$\testfolder |
$Build
Name | Description | Type | Usage Example |
---|
Id | A unique Integer allocated automatically to this build | string | $Build.Id$ |
Version | The build version. This is derived from the configuration 'Version Format String' field on the configuration details tab | version | $Build.Version.Default.Major$ |
StartedBy | The username of the user who initiated the build | string | $Build.StartedBy$ |
IsFeatureBranchBuild | Utilized via build triggers, this descriptor is set to true when a build is triggered on a non-default branch | Boolean | $Build.IsFeatureBranchBuild$ |
BuildNumber | The total number of builds | Numeric | $Build.BuildNumber$ |
Metrics | A placeholder for metrics related to this build (eg the number of unit tests passed) | Metrics | $Build.Metrics$ |
HasNewChanges | Does this build contain any new Changesets (which Continua has not yet seen) | Boolean | $Build.HasNewChanges$ |
LinkUrl | Build details Url (eg http:\\SERVERNAME\New_Project_1\ci\builds\view\123) | string | $Build.LinkUrl$ |
$Configuration
Name | Description | Type | Usage Example |
---|
Name | Name of the Configuration as defined on the Configuration Details Page | string | $Configuration.Name$ |
$Agent
Name | Description | Type | Usage Example |
---|
Port | The Port number used for agent communication | string | $Agent.Port$ |
Hostname | The Agents Hostname | string | |
Now | The current date and time given as agent local | datetime | $Agent.Now$ |
NowUTC | The Date and Time given as UTC | datetime | $Agent.NowUtc$ |
InstallPath | The installation path of the agent (eg C:\ContinuaAgentInstall) | string | $Agent.InstallPath$ |
GetUserEnvironmentVairable | Gets the specified user environment variable (relative to the agent machine's service user, and relative to the agent machine) | string | $Agent.GetUserEnvironmentVairable("TEMP")$ |
GetMachineEnvironmentVairable | Gets the specified Machine Environment Variable (relative to the agent machine) | string | $Agent.GetMachineEnvironmentVairable("NUMBER_OF_PROCESSORS")$ |
List of Property Collectors | What follows is a list of property collectors | Property Collector | $Agent.NuGet.Default.Path$ |
$Project
Name | Description | Type | Usage Example |
---|
Name | The name of the Project for which this configuration is a part of (as Provided on the Project Details page) | string | $Project.Name.ToLower$ |
Description | The description of the Project for which this configuration is a part of (as Provided on the Project Details page) | string | $Project.Description.ToLower$ |
Slug | A shorterned version of the project name which is safe to use within Url's and other identifiers. For example "New Project 1" would have a slug of "New_Project_1" | string | $Project.Slug.ToLower$ |
$Source
Name | Description | Type | Usage Example |
---|
List of the repositories associated with configuration | What follows is a list of repositories associated with the given configuration | Repository | $Source.Reponame$ |
$Server
Name | Description | Type | Usage Example |
---|
Now | The current date and time given as server local | DateTime | $Server.Now.Day$ |
NowUtc | The date and time given as UTC | DateTime | $Server.NowUtc.Month$ |
Hostname | The Continua server hostname | string | $Server.Hostname.ToLower$ |
InstallPath | The Continua server install path (eg C:\Program Files\VSoft\) | string | $Server.InstallPath.ToLower$ |
Url | The Server URL (eg http://ContinuaServerName) | string | $Server.Url.ToLower$ |
Repository (used by $Source )
Name | Description | Type | Usage Example |
---|
Branch | | String | $Source.aa.Branch.ToLower$ |
BranchName | | String | $Source.aa.BranchName.ToLower$ |
LatestChangeset | | Changeset | $Source.aa.LatestChangeset.Comment$ |
Path | | String | $Source.aa.Path.ToLower$ |
Tag | | String | $Source.aa.Tag.ToLower$ |
Type | | String | $Source.aa.Type$ |
Url | | String | $Source.aa.Url$ |
Changeset (used by $Source)
Name | Description | Type | Usage Example |
---|
Id | | | |
Comment | | | |
Repositoryusername | | | |
Branch | | | |
Branchname | | String | |
Created | | Date time | |
Filecount | | int | |
Committerusername | | String | |
Committerfullname | | String | |
Stage (used by $Source)
Name | Description | Type | Usage Example |
---|
Name | | | |
Metrics | | | |
Metrics (used by $Build)
Name | Description | Type | Usage Example |
---|
Compiler | | | |
Unit Tests | | | |
Version (used by $Source)
Name | Description | Type | Usage Example |
---|
Major | | | |
Minor | | | |
Build | | | |
Revision | | | |