You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 32
Next »
What are they?
Expressions are a mechanism for the autocompletion of objects whose values may not be known until build execution time. They can also be used to autocomplete variables.
Where can I use them?
Expressions can be utilised in several dialogue fields throughout Continua (they are especially useful within stage actions, and build event handlers).
The expansion icon (below) denotes fields that have expression capabilities.
Expression Expansion
To initiate n expansion simply type the dollar symbol '$' and the expression auto complete will present (note: not all objects are available in all fields).
$Workspace
Name | Description | Type | Usage Examples |
---|
N/A | The disk location (on the server or agent) of a builds' workspace. | string | $Workspace$\testfolder |
$Build
Name | Description | Type | Usage Examples |
---|
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 Examples |
---|
Name | Name of the Configuration as defined on the Configuration Details Page | String | $Configuration.Name$ |
$Agent
Name | Description | Type | Usage Examples |
---|
Port | The Port number used for agent communication | String | $Agent.Port$ |
Hostname | The Agents Hostname | String | $Agent.Hostname$ |
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")$ |
N/A | What follows is a list of property collectors | Property Collector | $Agent.NuGet.Default.Path$ |
$Project
Name | Description | Type | Usage Examples |
---|
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 Examples |
---|
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 Examples |
---|
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$ |
$Utils
Name | Description | Type | Usage Examples |
---|
NewGuid | Create a randomly generated Guid | Guid | $Utils.NewGuid$ |
RandomNumber | Generate a new random value. Optionally provide an minimum and maximum value. | DateTime | $Utils.RandomNumber("1", "10")$ $Utils.RandomNumber("1", "10")$ |
Repository (used by $Source )
Name | Description | Type | Usage Examples |
---|
Branch | | String | $Source.RepoName.Branch.ToLower$ |
BranchName | | String | $Source.RepoName.BranchName.ToLower$ |
LatestChangeset | | Changeset | $Source.RepoName.LatestChangeset.Comment$ |
Path | | String | $Source.RepoName.Path.ToLower$ |
Tag | | String | $Source.RepoName.Tag.ToLower$ |
Type | | String | $Source.RepoNamea.Type$ |
Url | | String | $Source.RepoName.Url$ |
Changeset (used by $Source)
Name | Description | Type | Usage Examples |
---|
Id | | String | $Source.RepoName.Id$ |
Comment | | String | $Source.RepoName.Comment$ |
Repositoryusername | | String | $Source.RepoName.Repositoryusername$ |
Branch | | String | $Source.RepoName.Branch$ |
Branchname | | String | $Source.RepoName.Branchname$ |
Created | | Datetime | $Source.RepoName.Created$ |
Filecount | | Int | $Source.RepoName.Filecount$ |
Committerusername | | String | $Source.RepoName.Committerusername$ |
Committerfullname | | String | $Source.RepoName.Committerfullname$ |
Stage (used by $Source)
Name | Description | Type | Usage Examples |
---|
Name | | | |
Metrics | | | |
Metrics (used by $Build)
Name | Description | Type | Usage Examples |
---|
Compiler | | | |
Unit Tests | | | |
Version (used by $Source)
Name | Description | Type | Usage Examples |
---|
Major | | | |
Minor | | | |
Build | | | |
Revision | | | |