Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

@@continua[setBuildVariable name='possiblyUnDefinedVariable' value='Hello world!' skipIfNotDefined='true']
@@continua[setBuildVariable name='counter' value='1' appendOrIncrement='true']
@@continua[setBuildVariable name='counter' regExPattern='v([\d]*)\.([\d]*)\.([\d]*)\.([\d]*)' replacement='version $1.$2.$3 with build number $4']



setServerVariable - Sets the value of a Continua CI server variable (Configuration, Project or Application variable)

...

  • name: The variable name. This is required.
  • value: The new value to set the variable to . This is required.
  • appendOrIncrement: When true, append the new value to variable or type text or increment the value of a numeric variable type by the new value. Defaults to false which replaces the current value with the new value.
  • regExPattern: A regular expression pattern to match against the existing variable value.
  • regExIgnoreCase: When true, ignore case when matching regular expression. Defaults to false.
  • regExFirstMatchOnly: When true, replace first regular expression match only. Defaults to false.
  • replacement: The regular expression replacement text. This may contain back references to captured groups in the regular expression pattern, see Substitutions in Regular Expressions
  • skipIfNotDefined: When true, prevents the build failing if the variable has not been defined for the configuration. Defaults to false.
  • expand: When true, expands any expressions in the value or replacement.  Defaults to false.
  • updateBuildVariable: When true, updates the corresponding build variable with the new value of the server variable. Defaults to false.
  • updateAgentVariable: When true, updates the corresponding agent variable, referred to as %Configuration.VariableName%, %Project.VariableName% and %Application.VariableName%, with the new value of the server variable. Defaults to false.
  • keepBuildWriteLock: When true, keeps any write lock acquired until the end of the build. Defaults to false.
  • releaseLockOnStageEnd: When true, releases any write lock acquired at the end of the stage rather than end of build. Defaults to false.

Examples: 

@@continua[setServerVariable namesetServerVariable name='allowupload' value='true']
@@continua[setServerVariable namesetServerVariable name='possiblyUnDefinedVariable' value='Hello world!' skipIfNotDefined='true']
@@continua[setServerVariable name='counter' value='1' appendOrIncrement='true' updateBuildVariable='true' updateAgentVariable='true' keepBuildWriteLock='true']
@@continua[setServerVariable name='counter' regExPattern='v([\d]*)\.([\d]*)\.([\d]*)\.([\d]*)' replacement='version $1.$2.$3 with build number $4' keepBuildWriteLock='truė' releaseLockOnStageEnd='true']


Info

If another build has a lock on the server variable then the setServerVariable message will fail. Due to the one-way nature of custom log message, we cannot pause the running process to respond and retry. We recommend that you use the Acquire Server Variable Lock action to ensure that you own a lock on the variable before running process which use this message


...

Info

If another build has a lock on the server variable and the acquireBuildWriteLock parameter is true then the loadVariable loadVariable message will fail. Due to the one-way nature of custom log message, we cannot pause the running process to respond and retry. We recommend that you use the Acquire Server Variable Lock action to ensure that you own a lock on the variable before running process which use this message


acquireServerVariableLock acquireVariableLock - Acquires a write lock on a server variable so that no other builds can modify the value of the server variable until the lock is released, either at the end of the build or by another action

...

  • name: The variable name. This is required.
  • releaseLockOnStageEnd: When true, releases any write lock acquired at the end of the stage rather than end of build.

Example: 

@@continua[acquireServerVariableLockacquireVariableLock name='buildCounter1' releaseLockOnStageEnd='true' ]

Info

If another build has a lock on the server variable then the acquireServerVariableLock acquireVariableLock message will fail and log an error. Due to the one-way nature of custom log message, we cannot pause the running process to respond and retry. We recommend that you use the Acquire Server Variable Lock to ensure that you own only use this message if you are sure no other builds can hold a lock on the variable before running process which use this message, e.g. after acquiring a shared resource lock.


releaseVariableLock - Releases any a write lock on a server variable acquired by the current build. A warning will be logged if the current build does not hold a lock on the variable.

...