Skip to main content

Approvals

This tutorial demonstrates how to use approvals in Harness CD pipelines.

Before you begin

Before you start this tutorial, you need to have a Harness CD pipeline with active delegates and connectors. Please follow this tutorial that gets you started with Harness Continuous Delivery (CD). The tutorial below uses the Harness resources created as part of the get-started tutorial.

Harness User Group: This tutorial uses Harness User Groups to manage user access. Create a user group named approval-demo at the account level, and add yourself as a user.

You can specify Harness User Group(s) to approve or reject a Pipeline at any point in its execution. During deployment, the User Group members use Harness Manager to approve or reject the Pipeline deployment manually.

Approvals can be added in between Stages to prevent the Pipeline execution from proceeding without an approval.

Add an Approval stage

  1. In the visual view of the pipeline, select Add Stage, and then select Approval as the stage type.

  2. Name the stage manual-approval-stage, and select Harness Approval as the approval type.

  3. Select the Approval step to open the Manual Approval pane. The Manual Approval pane includes predefined values for Name, Timeout, and Approval Message. You need to add the User Group you created under Approvers. You can also add Approver Inputs under this step.

  4. Select Apply Changes. Your approval step is created.

  5. Save the changes to the pipeline.

  6. Since you already have a deploy stage present before the approval stage, drag the deploy stage to the right of the approval stage.

  7. Verify and confirm the approval stage and deploy stage as shown below.

  8. Select Save, and then select Run to run the pipeline.

  9. As an approver, you'll receive notification on the Console Log pane under the Logs once the pipeline is running to approve or reject the pipeline. Click on Approve to run the pipeline.