Run a Script in a CI Stage
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:
- Step 1: Create the CI Stage
- Step 2: Add the Codebase
- Step 3: Define the Build Farm Infrastructure
- Step 4: Configure a Run Unit Test stage
- Step 5: Run the Pipeline
- Step 6: View the Test Report
- See Also
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.
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.
- Click Save and Publish.
- Click Run. The Pipeline Inputs settings appear.
- In CI Codebase, click Git branch.
- In Git Branch, enter the name of the branch where the codebase is, such as a master.
- 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.