A pipeline is an end-to-end process that completes a workflow, such as delivers a new version of your software. Each pipeline has stages that perform one major segment of the pipeline process.
You might encounter situations where you want to run some, but not all, stages. For example, if only one stage fails, you might want to rerun only the failed stage. In Harness, you can select specific stages to run, rather than the entire pipeline.
This topic assumes you're familiar with Harness' key concepts, you have a Harness project, and you have a pipeline with multiple stages. You must also have Execute permissions for pipelines in your project, such as the Pipeline Executor role.
Dependent and independent stages
Stages can be dependent on input from previous stages.
Some settings can be propagated from one stage to another, such as infrastructure settings, Services, and Environments. Also, you can use expressions to reference stage settings, such as stage variables, and step input and outputs across stages.
An independent stage is a stage that doesn't use settings from any other stage.
A dependent stage is a stage that uses another stage's settings. To run a dependent stage, you either need to provide the dependencies as runtime inputs or run the dependent stage and all the stages it depends on.
Enable selective stage executions
To run specific stages, you must enable selective stage execution.
- In your pipeline, select Advanced Options in the Pipeline Studio's Visual Editor.
- In Stage Execution Settings, select Yes for Allow selective stage(s) executions.
Run specific stages
Go to your pipeline, and then select Run.
Select Stages, and then select the independent stages that you want to run.
If required, provide runtime inputs.
Select Run Pipeline.
You can view the execution details in the pipeline's execution history.
Rerun stages from execution history
When viewing execution details for a previous pipeline run, you can select Re-run or Re-run Stage to rerun a single stage. If necessary, you're prompted to provide runtime inputs.