Skip to main content

CI Build stage settings

This topic describes CI Build stage settings. For more information about configuring stages in CI pipelines, go to CI pipeline creation overview.

To create, edit, and delete stages in CI pipelines, you need either Project Admin or Project Member permissions. For more information, go to the Permission Reference.

Stage Name

Enter a name summarizing the stage's purpose. Harness automatically assigns an Id (Entity Identifier Reference) based on the Name. You can change the Id.

Description

Optional text string.

Tags

For details, go to the Tags Reference.

Clone Codebase

When selected, Harness automatically clones the codebase before executing the steps in the stage.

If not selected, Harness does not clone the codebase when initializing the stage.

Configure Codebase

Specify the pipeline's default codebase configuration. These settings are available when you add the first stage to a pipeline. After adding the first stage, these are managed under the pipeline's overall Codebase settings.

Connector

A Harness code repo connector that connects to the repository where the codebase is located. For information about code repo connectors, go to Create and configure a codebase.

Repository URL

If not populated by default, enter the full URL to the code repository that you want the pipeline to use.

Overview

These settings are found on the Overview tab after adding a stage to a pipeline.

Stage Details

You can edit the Name, Description, and Tags. You can also toggle the Clone Codebase setting for this stage.

Shared Paths

You can use Shared Paths to share data across steps or customize cache paths for Cache Intelligence by specifying paths folders outside the default workspace.

When a pipeline runs, it creates a temporary volume called a workspace. During initialization, the stage clones your codebase to the root of the workspace. Then, the steps in the stage run inside the root. The workspace is the current working directory for each step in the stage. The workspace persists for the lifetime of the stage and enables steps in that stage to communicate and share state information. The default shared working directory for a stage is /harness. The workspace is destroyed when the stage ends.

Individual steps can communicate and share state using the workspace filesystem. The workspace is a volume, so filesystem changes persist throughout the stage lifetime. If you need to share additional volumes, you can add Shared Paths. Path declarations must begin with a forward slash, such as /vol.

For example, the maven m2 repo is stored in /root/.m2 by default. If your Build stage uses Maven, you can specify /root/.m2 as a Shared Path so that all steps in that stage can access that directory.

Advanced: Stage Variables

Stage variables are available to all steps in the stage. For an example use case, go to Build a Docker image without pushing.

Infrastructure

These settings are found on the Infrastructure tab after adding a stage to a pipeline.

Infrastructure is where the build runs the steps in this stage. It is a build farm, such as a Kubernetes cluster. Infrastructure settings vary by build infrastructure type.

The first stage requires you to configure a build infrastructure. In stages after the first, you can either Propagate from an existing stage or Use a New Infrastructure.

Use the Cloud infrastructure option for Harness Cloud build infrastructure.

The following Platform settings are available:

  • Select the Operating System: Select the relevant OS.
  • Select the Architecture: Select the relevant architecture.

Execution

The Execution tab is where you add steps to the stage. For details about different step types, go to:

Advanced

The Advanced tab contains settings for conditional execution, looping strategies, and failure strategies.