Rollback pipelines
Pipeline rollback is a type of failure strategy that allows you to roll back the entire pipeline upon stage or step failure.
Pipeline Rollback strategy applies to CD step and stages, STO stages, and CI stages. Pipeline rollback failure strategy defined in STO and CI stages depends on the rollback steps defined by the user.
Currently, the Rollback Pipeline failure strategy is available for the following deployment types only:
- Kubernetes
- Native Helm
- Amazon Elastic Container Service (ECS)
Configure a rollback failure strategy
- In your pipeline, go to the step or stage where you want the rollback strategy to be triggered if that step or stage fails.
- Go to the Advanced settings for the selected step or stage.
- under Failure Strategy, locate On failure of type, and select the error type that you want to trigger the rollback.
- Under Perform Action, select Rollback Pipeline.
Here's an example of the YAML for a pipeline rollback failure strategy that triggers on any error.
failureStrategies:
- onFailure:
errors:
- AllErrors
action:
type: PipelineRollback
During pipeline execution, if the failure event occurs that triggers the rollback failure strategy, all steps and stages are rolled back accordingly.
If a pipeline uses pipeline chaining (where one or more stages are actually other pipelines), rolling back the parent pipeline does not roll back the child pipeline, because the child pipeline is considered a separate pipeline execution. In such cases, only the deployment stages of the parent pipeline roll back.