Continua CI takes a copy of the configuration, project and application variables (collectively known as server variables) at the start of each build. These copies are referred to as Build Variables. Any changes to server variables by other builds or by user edits are not reflected in the value of the build variable.
The Load Build Variable build event handler allows you to load the build variable with the current value of the corresponding server variable when specific events happen in the build timeline.
Load Build Variable
Variable Name
Select an existing variable. The drop down list will show all Configuration, Project and Application variables except for Expression variables which are read only.
Persist On Build Event
Specify when to load the build variable by selecting one of the following Build Events:
- 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
Some build events will allow you to specify the Stage or Build Status
Stage
For stage events you can choose the stage name or select "(all stages)"
Build Status
For completion events you can choose the status which triggers the build event handler. This can be Successful, Failed or Any.
Options
Do not overwrite if modified
Tick this to ensure that we don't overwrite any changes to the Build variable made so far during the build process. i.e. since the current 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 Build variable is stored on this event and this is compared with the current value before loading. If the value has changed since this event that the new server value will not be loaded.
Log warning if not loaded
A warning is added to the build log if this is ticked and the variable value is not loaded due to the modification check.
Fail build if not loaded
The build will fail if this is ticked and the variable value is not loaded due to the modification check.