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

Configuring Code Download

Configure the code download mode. You can use the specified code repository tag or commit ID to build the code. In addition, you can enable the automatic update of submodules and Git LFS.

Configuration Description

Configure the code download.

The parameters are described in the following table.

Parameter

Description

Specify Repository Tag or Commit ID

Three options are available: Do not specify (do not specify a tag or a commit ID), Tag (specify a tag), and Commit ID (specify a commit ID).

Auto Update

Submodule is a concept of Git and is used to solve the problem that a code repository contains and uses the code repository of other projects. For details, see Submodules (Git Submodule).

  • Enabled: If the code repository contains submodules, the system automatically pulls the code from the submodule repository during a build.
  • Disabled: The system does not automatically pull the code of the submodule repository.

Enable Git LFS

Determine whether to enable Git LFS to pull all files, including large files, such as audios, videos, and images, during a build. By default, these files are not pulled.

Build by Tag

A tag is associated with a code repository. If you select Repo as the code source, you can create a tag by referring to Managing Tags.

  1. When creating a build task, select Tag to use the code of a previous version.
  2. During task execution, a dialog box is displayed. Enter the tag name and click Confirm to run the task.

Build by Commit ID

A commit ID is the number generated when the code is committed. If you select Repo as the code source, the commit ID is displayed in the code repository as shown in the following figure.

In a build task, you can specify the commit ID to use the code of a previous version for building.

  1. Select Commit ID, enter the clone depth, and save the task.

    The clone depth is the number of revisions of the repository that will be cloned. A larger value indicates a longer time for checking out the code. The clone depth must be a positive integer. The recommended maximum depth is 25.

    For example, if Clone Depth is set to 5, you can set Commit ID to any of the previous five commits.

  2. Enter the commit ID and click Confirm to start the task.