Pipelines define your release process using multiple Workflows and approvals in sequential and/or parallel stages. Pipelines can involve multiple Services, Environments, and Workflows. A Pipeline can be triggered either manually or automatically (see Triggers).

This topic covers the following:

Before You Begin

Video Summary

RBAC and Pipelines

Your ability to read, create, delete, and update Pipelines depends on the Pipeline Application Permissions of your User Group:

Your ability to deploy Pipelines also depends on your Deployments Application Permissions:

See Managing Users and Groups (RBAC).

Create a Pipeline

The following procedure creates a simple pipeline using a single service and a single workflow.

To create a pipeline, do the following:

  1. Click Setup.
  2. Click the application with a service you want to deploy.
  3. Click Pipelines. The Pipelines page appears.
  4. Click Add Pipeline. The Add Pipeline dialog appears.
  5. Enter a name and description for your pipeline and click SUBMIT. The first stage dialog appears. It has the following fields.



    Editable Title

    You can add a title to your stage. For example, Prepare. This will be visible in the Pipeline Overview.

    Execution Step

    Select this option to execute this stage when the pipeline runs.

    Approval Step

    Select this option to require approval before the next stage executes. You can use Harness User Groups, a Custom Shell Script, or Jira.

    Step Name

    Name the step in this stage. This name acts as a subheading to the stage name.

    Execution Workflow

    Select the workflow to execute in this pipeline. The workflows in your application are available.

    Execute in parallel with previous step

    Select this option to execute steps in parallel.

    Disable step

    Select this option to disable this step in this stage. This allows you to control which stages and steps in the deployment pipeline are executed.

  6. Click SUBMIT. The pipeline stage and its step are added to the pipeline.
  7. To add another stage to the pipeline, click the plus icon. A new stage dialog appears.

Workflow Variables in Pipelines

Once you have templatized a workflow, you can use it in multiple stages of a pipeline. For example, you can templatize the Environment and Service Infrastructure/Infrastructure Definition of a workflow, and then use the same workflow for both the QA and Production stages of a pipeline. When you add the workflow to each stage, you simply provide QA and Production-specific values for Environment and Service Infrastructure/​Infrastructure Definition variables.

For more information, see Templatized Workflows in Pipelines.

Deploy a Pipeline

Once you have set up a pipeline, you can deploy it, running all the stages within the pipeline. Before running a pipeline, verify that all the artifact servers and cloud providers are available to the accounts you used to set them up.

You can also deploy any workflow, whether it is within a pipeline or not. For more information, see Add a Workflow.

To deploy a pipeline, do the following:

  1. In your application, click a pipeline. The Pipeline Overview appears.
  2. In the pipeline title bar, click Deploy. The Start New Deployment dialog appears.
    When you set up the pipeline stage(s), you picked the workflow(s) the pipeline will execute. The workflow you selected is linked to a service. The Start New Deployment dialog is configured with the services linked to the workflows included in the pipeline. Here is an example of a pipeline linked to three workflows, each with a separate service.
  3. For each service in the pipeline, select Build/Version that the pipeline will deploy.
  4. To run your pipeline, click SUBMIT. The pipeline is deployed and the deployment steps are displayed in the Deployment Detail page.
    Click each phase in the process to see logs and other details of the process.

Abort or Rollback a Running Deployment

If you deploy a pipeline and choose the Abort option during the running deployment, the Rollback Steps for the workflow(s) in the pipeline are not executed. Abort stops the deployment execution without rollback or clean up. To execute the Rollback Steps, click the Rollback button.

Abort Button

Rollback Button

Pipeline Example

In most deployment processes there are multiple stages and approvals. Harness enables you to quickly configure the common three stage deployment pipeline (Dev, Stage, Production) along with the approval steps. Here is an example of a pipeline involving the common deployment process.

In this pipeline, the Dev and Stage workflows are each completed with an approval step where DevOps can verify that the stage has completed successfully without rollback before approving the next stage. Finally, with all stages successful and approved, the pipeline completes with a production release. The production release is also verified and rolled back if necessary.

Next Steps

How did we do?