Help Center> CodeArts Build> User Guide> Configuring Build Actions> Code-based Build> Configuring a Task> Using YAML to Download Code from Multiple Repositories via Manifest
Updated on 2024-04-18 GMT+08:00

Using YAML to Download Code from Multiple Repositories via Manifest

In scenarios such as Android and Harmony, hundreds or even thousands of code repositories need to be integrated at the same time during one build. The integration and download efficiency of multiple code repositories is critical.

CodeArts Build has integrated the CodeArts Repo download tool. You only need to perform simple configurations to download multiple code repositories. Currently, CodeArts Repo and Gerrit are supported.

The following configurations are for your reference.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
version: 2.0 # The value must be 2.0.
steps:
  PRE_BUILD:
  - manifest_checkout:
      name: "manifest"
      inputs:
        manifest_url: "https://example.example.example.example.example.com/xx/manifest.git"
        manifest_branch: "master"
        manifest_file: "default.xml"
        path: "dir/dir02"
        repo_url: "https://example.example.example.example.example.com/xx/git-repo.git"
        repo_branch: "master"
        username: "someone"
        password: "${PASSWD}"

The parameters are described in the following table.

Parameter

Type

Description

Mandatory

Default Value

name

string

Step name.

No.

manifest_checkout

manifest_url

string

Specifies the manifest repository address, including the repository of XML files.

Yes.

None

manifest_branch

string

Specifies a manifest branch or revision.

No.

HEAD

manifest_file

string

Manifest file path.

No.

default.xml

path

string

Download path of all sub-repositories of the customized manifest file, which is the relative path of the working path.

The path cannot start with a slash (/) and cannot contain any period (.).

No.

The working path

repo_url

string

Repo repository address.

No.

https://gerrit.googlesource.com/git-repo

repo_branch

string

Repo repository branch.

No.

stable

username

string

Username for downloading the repository.

No.

This parameter is mandatory when a non-public repository is downloaded.

None

password

string

HTTPS password used for downloading the repository.

No.

This parameter is mandatory when a non-public repository is downloaded.

None

  1. The repositories defined in manifest_file must be of the same source code source.
  2. manifest_url and manifest_file must use the same code source. For a non-public repository, username and password must have the download permission.
  3. The repo repository corresponding to repo_url must have the download permission (the repository is open-source, or the repository is private but configured with an account and password).
  4. If the values of the preceding optional parameters are empty, the default values are used.
  5. When a non-public repository is used, you are advised to configure the username and password using the constructed private parameters. For details, see Parameter Settings.