You can add a Rollback Pipeline failure strategy to your pipelines. Rollback pipeline applies to all steps and stages in a pipeline.
If a pipeline includes a child pipeline as a stage (Pipeline chaining), rolling back the parent pipeline will not roll back the child pipeline as the latter is considered as a separate execution. In such cases, only the deployment stages of the parent pipeline roll back.
Currently, the Rollback Pipeline failure strategy applies to the following deployments only:
- Native Helm
- Amazon Elastic Container Service (ECS)
Rollback pipeline steps or stages
In a pipeline's step or stage, select Advanced.
In Failure Strategy > On failure of type, select a failure type or select All Errors. Go to Step and Stage Failure Strategy Settings for information about error types.
In Perform Action, select Rollback Pipeline.
Here's the equivalent YAML for the Pipeline Rollback failure strategy:
During pipeline execution, in Permissible Actions, if you select Mark as Fail, the pipeline stage fails and rolls back.
If you select Mark as Success, the stage passes, and the next stage's execution begins.