6 - Artifact Build and Deploy Pipelines
Pipelines define your release process using multiple Workflows and approvals in sequential and/or parallel stages. And Artifact Build and Deploy Pipeline simply runs your Build Workflow followed by your Deploy Workflow. The Deploy Workflow uses the Harness Service you set up to get the new build number.
To create the Artifact Build and Deploy Pipeline, do the following:
- In your Harness Application, click Pipelines, and then click Add Pipeline. The Add Pipeline dialog appears.
- In Name, enter a name for your Pipeline, such as Artifact Build and Deploy.
- Click SUBMIT. The new Pipeline is created.
Add the Build Workflow as the first stage in the Pipeline:
- In Pipeline Stages, click the plus button. The Pipeline Stage dialog appears.
- In Step Name, enter a name for the Build Stage, such as Build Artifact.
- In Execute Workflow, select the Build Workflow you created. When you are done, it will look something like this:
- Click SUBMIT. The stage is added to the Pipeline.
- Use the same steps to add the Deploy Workflow to the Pipeline. When you are done, it will look something like this:
- Click Deploy to run the Pipeline. Note that you do not need to select an artifact build number as the Deploy Workflow will obtain the latest build.
- Click SUBMIT.
The Workflows are run in succession. First, the Build Workflow is run. Click the Artifact Collection step to see the metadata collected by Harness, including the build number:
You can see the same build number in Jenkins:
Next, the Deploy Workflow is run. Click the Artifact Check step to see the same build number that was collected by the Artifact Collection step. You can also see the build number next to the Artifacts heading.
The Pipeline has been run successfully. You can now build and deploy artifacts by running a single Pipeline.