Updated on 2024-05-30 GMT+08:00

Using YAML to Configure BuildSpace

Background

In CodeArts Build, an empty path (for example, /devcloud/ws/sMMM/workspace/j_X/) is randomly assigned to a build task as the root directory by default. This directory is called a "BuildSpace". Even for build tasks in the same project, BuildSpaces are randomly assigned to them.

However, a fixed BuildSpace path is necessary in some scenarios. CodeArts Build allows users to configure BuildSpace to specify a fixed directory for a build.

Prerequisites

You have an available environment, which can be custom executors, build parallel packages, or L3 build acceleration packages.

Configuration Description

Add the following code to the YAML file:

version: 2.0
buildspace: # BuildSpace is used.
  fixed: true
  path: kk  
  clean: true
  clean_exclude:
    - cache # Excluded path
    - aa # Excluded path
    - bb # Excluded path

The code parameters are described in the following table.

Parameter

Type

Description

Mandatory

Default Value

fixed

string

  • true: A fixed path is used.
  • false: A random path is used.

Yes

false

path

string

The fixed path is in the following format: /devcloud/slavespace/usr1/+"${domainId}"+/. You can set the path parameter to add a path after the fixed path.

For example, if the path is set to kk, the fixed path is /devcloud/slavespace/usr1/+"${domainId}"+/kk.

No

None

clean

string

  • true: The fixed path will be cleared. Files in the fixed path will be deleted each time the build task is complete.
  • false: The fixed path will not be cleared. When the total size of files reaches the maximum capacity of the workspace, you need to manually clear the space by setting clean to true.
    NOTE:

    The space refers to the custom executor specifications.

Yes

true

clean_exclude

string

This parameter indicates that paths excluding the set paths need cleanup. Only level-1 folders in a fixed path can be specified.

Yes

N/A