Updated on 2023-12-21 GMT+08:00

Using YAML for Build

Prerequisites

  • A project is available. If no project is available, create one.
  • A code repository has been created in the project. If no code repository is available, create one.
  • In the code repository, create the .cloudbuild directory and store the YAML file in the directory. For details about how to write the YAML file and its specifications, see Introducing the YAML File Structure.

    If the YAML file is not stored in the .cloudbuild directory, you can use CB_BUILD_YAML_PATH to specify the path of the YAML file in the code repository.

Selecting a Code Source

  1. Log in to the CodeArts Build homepage.
  2. Click Create Task. The Basic Information page is displayed.
  3. Select Repo as the source code source and configure the source code repository and branch to be used.

Configuring and Executing the YAML Build Task

  1. Click Next. The Build Template page is displayed.
  2. Select Blank Template and click Next.

    Or select a recommended template. This does not affect the YAML build.

  3. Go to the Build Actions tab page. In the upper left corner, select the Code tab.

    You can modify the YAML file here. The system automatically reads the YAML file in the code repository and branch configured when you select a code source.

  4. After the configuration, click Create in the upper right corner.
  5. Click Create and Run. Changes to the YAML file take effect and the YAML build task file is executed. After the build script is submitted, the original build.yml file is overwritten.