Continua CI takes a copy of configuration, project and application variables at the start of each build. These copies are referred to as Build Variables. Any changes to build variables are normally discarded when the build finishes and cannot be used by other builds.
The Persist Build Variable build event handler allows you to save the value of build variables when specific events happen in the build timeline. This is stored as the value of the configuration variable. Subsequent builds will then pick up this revised value and use it as the initial value of the build variable.
Select an existing variable. The drop down list will show all Configuration, Project and Application variables except for Expression variables which are read only.
Specify when to persist the build variable by selecting one of the following Build Events:
Some build events will allow you to specify the Stage or Build Status
For stage events you can choose the stage name or select "(all stages)"
For completion events you can choose the status which triggers the build event handler. This can be Successful, Failed or Any.
Tick this to ensure that we don't overwrite Configuration, Project or Application variables set by other concurrent builds or by other users since the build or stage started.
Since Build Event
Select one of the following Build Events:
On Build Created
On Before Build Queued
On Before Build Start
On After Build Started
On Before Stage Start
On Sending Stage To Agent
On Stage Completed
On Build Pending Promotion
On Before Build Continue
On After Build Continued
On Before Build Stage Requeued
The value of the Configuration, Project or Application variable is stored on this event and this is compared with the current value before persisting. If the value has changed since this event that the new value will not be persisted.
A warning is added to the build log if this is ticked and the variable value is not persisted due to the modification check.
The build will fail if this is ticked and the variable value is not persisted due to the modification check.
A new tab is displayed when this is ticked with options for setting the build variable value before persisting.
You can optionally update the value of the build variable before persisting.
Choose 'Replace' to overwrite the existing variable value, or 'Append or increment' to make changes to existing values. In the later case, the new value is be appended to the old value for text variable. For numeric variable values, the old value will be incremented by the new value.
Input the new value for the variable.
If you select this option then any expression is the value will be expanded before the value is set.