For the complete documentation index, see llms.txt. This page is also available as Markdown.

Rollback pipelines

Rollback pipelines to handle different failure conditions.

Pipeline rollback is a type of failure strategy that allows you to roll back the entire pipeline upon stage or step failure.

Pipeline Rollback is available by default for CD steps and stages. For all other stages, pipeline rollback is behind the feature flag CDS_ALLOW_EXPRESSION_RESOLUTION_PIPELINE_ROLLBACK. Please contact Harness Support to enable this feature flag.

Configure a rollback failure strategy

  1. In your pipeline, go to the step or stage where you want the rollback strategy to be triggered if that step or stage fails.

  2. Go to the Advanced settings for the selected step or stage.

  3. under Failure Strategy, locate On failure of type, and select the error type that you want to trigger the rollback.

  4. 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.

Last updated

Was this helpful?