ensure
step hook
Any step can have ensure
tacked onto it, whose value is a second step to execute regardless of the result of the parent step.
ensure: step
The step to execute. Regardless of whether the parent step succeeds, fails, or errors, this step will be executed. The step will also be executed if the build was aborted, and its parent step was interrupted.
If the parent step succeeds and the ensured step fails, the parent step is considered to have failed.
The ensured step executes after any on_success
step hooks or on_failure
step hooks.
Examples
Releasing a Lock
For example, the following build plan acquires a lock, and then ensure
s that the lock is released.
plan:
- put: some-lock
params: acquire: true
- task: integration
file: foo/integration.yml
ensure:
put: some-lock
params: release: some-lock