You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Set Variable

Name

A friendly name for this action (will be displayed in the actions workflow area).

Enabled

Determines if this action will be run within the relevant stage.

Variable

This drop down contains a list of Configuration, Project and Application variables accessible to the configuration. See Variables for details on how to create a variable. Note that Expression variables cannot be modified and are therefore not listed.

Operation

You can choose to run one of the following operations on the variable:

  • Replace: The variable's value will be overwritten with the new value.
  • Append or increment:  For Text type variables, the new value will be appended to the old value. For Numeric type variable values the old value will be incremented by the new value. DateTime/Date/Time variables cannot be incremented or appended to. Not you can decrement Numeric type variables by using negative number as the new value.
  • Replace using a regular expression:  This allows you to overwrite parts of the variable's old value which match a regular expression pattern. 

New Value

The new value of the variable used for Replace and "Append or increment" operations.

Note: Any date time variable values should be entered as UTC. Full date time format is: yyyy-MM-dd'T'HH:mm:ss'Z' e.g. 2099-12-31T23:59:59Z

Expand variable references in new value

If  this option is ticked, then the New Value will be expanded (if there's any expressions in it) before it is used to replace, append, or increment the variable's value.

Pattern

Available for the "Replace using a regular expression" operation. A regular expression pattern to match against the existing value of the variable. 

Ignore case when matching regular expression

When ticked regular expression pattern will match both lower and upper case characters

Replace first regular expression match only

When ticked only the first regular expression pattern match will be replaced

Replace With

Available for the "Replace using a regular expression" operation. This text will used to replace regular expression matches in the variable's value. This may contain back references to captured groups in the regular expression pattern, see Substitutions in Regular Expressions. Note these need to be escaped e.g. $1 => $$1 if expanding.

Expand variable references in replacement value

If  this option is ticked, then the Replace With will be expanded (if there's any expressions in it) before it is used to replace regular expression matches in the variable's value.


Set

This drop down contains a list of variable types that this action can set:

  • Build variable: This is the default option and is used to set the value of the build variable only. Build variables inherit the value of the Configuration, Project or Application server variable at the start of the build. Changes to the build variable, either manually entered into the Queue Options prompt or set by actions such as this one are specific to the build. Build variables are not accessible by other builds.
  • Server variable:  This option is used to set the value of Configuration, Project and Application variables. These variables that you can edit manually on the server are referred to as Server variables. The values of these variables determine the initial value of build variables at the start of each build. Server variables are therefore accessible across multiple builds within their defined scope.
  • Server variable and overwrite build variable with result:  This option allows you to set both the server variable and the build variable.

Synchronise agent variable with updated server variable value

Variable expressions prefixed with a namespace, such as %Configuration.VariableName%, %Project.VariableName% and %Application.VariableName%, contain the value of the server variable at the start of the build. These can be referred to as agent variables.

When this option is ticked, the value of agent variables are updated with the new value set for the server variable.

Acquire a write lock on the server variable

A write lock will be acquired when updating the server variable. Tick this option to extend the write lock until the end of the build. This will prevent other builds and users from updating the variable value for the duration of the build. 

Release write lock at the end of stage

A write lock will be acquired when updating the server variable. Tick this option to extend the write lock until the end of the build. This will prevent other builds and users from updating the variable value for the duration of the build. 


WORK IN PROGRESS

------


Note: When a variable is set during a build, it is copied from the Configuration variables namespace and stored in Build variable namespace. This means you can still reference the variable's original value by using %Configuration.MyVariable%. Otherwise, to use the updated value, simply reference the variable by its name %MyVariable%

Operation

You can choose to replace a variable's value or append/increment it. If you choose to append/increment then it takes in the value type of the variable.

For text/expression type variables the new value will be appended to the old value.

For numeric type variable values the old value will be incremented by the new value.

New Value

The new value of the variable.

Note: Any date time variable values should be entered as UTC. Full date time format is: yyyy-MM-dd'T'HH:mm:ss'Z' e.g. 2099-12-31T23:59:59Z

Expand variable references in new value

If you select this option then the value will be expanded (if there's any expressions in it) when the variable is used and the new value will be set to it.


  • No labels