Run a Script in a CI Stage

Updated 3 months ago by Manish Jaiswal

The Build stage Run step can be used to run scripts in your CI stages.

In this topic, we will cover how to run a simple script in a CI stage.

In this topic:

Before You Begin

Step 1: Create the CI Stage

In your Harness Pipeline, click Add Stage, and then click CI.

Step 2: Add the Codebase

Do one of the following:

  • If this is the first CI stage in the Pipeline, in the CI stage settings enable Clone Codebase.
  • If you have an existing Pipeline with a CI stage, click Codebase. See Edit Codebase Configuration.

Step 3: Define the Build Farm Infrastructure

In the CI stage Infrastructure, define the build farm for the codebase.

See Kubernetes Cluster Build Infrastructure Setup.

Step 4: Configure a Run Unit Test stage

In the CI Execution, Click Add step and then click Run.

The Run step executes one or more commands on a container image.

For Step Settings on configuring a Run step, see Run Step Settings.

Step 5: Run the Pipeline

Now you can run your Pipeline.

  1. Click Save and Publish.
  2. Click Run. The Pipeline Inputs settings appear.
  3. In CI Codebase, click Git branch.
  4. In Git Branch, enter the name of the branch where the codebase is, such as a master.
  5. Click Run Pipeline.

Step 6: View the Test Report

Once the Pipeline is executed in CI, Click Tests. The Tests show the test report of the unit test we configured and ran. 

See Also

Please Provide Feedback