Help Center/ CodeArts Build/ User Guide/ Creating a Build Task/ Defining a Build Task on GUI
Updated on 2024-11-21 GMT+08:00

Defining a Build Task on GUI

CodeArts Build provides a graphical user interface (GUI) where you can configure build tools and parameters.

Preparations

  • To use CodeArts Repo repositories, you must have the operation permissions on CodeArts Repo.
  • Create a CodeArts project by referring to CodeArts User Guide > "Preparations" > "Creating a Project".

    If you already have a project available, skip this step.

  • by referring to CodeArts Repo User Guide > "Creating a CodeArts Repo Repository".

    If you already have a CodeArts Repo repository or are using a third-party repository, skip this step.

Creating a Build Task with GUI

  1. Access the CodeArts Build Homepage from the project list.
  2. Click Create Task. On the displayed page, configure the basic information of the build task by referring to Table 1. Click Next. The page for selecting a build template is displayed.
    Table 1 Basic information

    Parameter

    Description

    Name

    Assign a custom name to the build task.

    • Letters, digits, underscores (_), and hyphens (-) allowed.
    • 1 to 115 characters.

    Project

    Select the project to which the build task belongs.

    • This parameter is autofilled when you access CodeArts Build through the project list, so you can leave it as default.
    • When accessing the service through the service homepage, select the project created in preparations.

    Code Source

    Select the source from where the code to be compiled is pulled.

    • Repo: Code is pulled from CodeArts Repo for your build.
    • Pipeline: If Pipeline is selected as a code source, the build tasks can be executed only by running the corresponding pipeline and cannot be executed independently.

    The following code repositories are provided by third-party sources and not by CodeArts.

    • GitHub: Code is pulled from GitHub for your build.
    • Git: Code is pulled from other services for your build.

    Service Endpoint

    Optional. You need to set this parameter when the Code Source is set to a third-party code repository. If you are using a third-party code repository for the first time, you will need to create a service endpoint. For details, see Creating a Service Endpoint.

    Repository

    Select the repository from where the code to be compiled is pulled.

    Default Branch

    Select a default branch.

    Description

    Optional. Enter additional information to describe the build task. Max. 512 characters.

  3. CodeArts Build has more than 30 built-in build templates. You can select a template that suits your requirements and click OK to create the build task.
  4. On the displayed Build Actions page, you can continue with configuring a build task.

Turning a Task Into a Template

You can save the current build task as a template for later build task creation. The procedure is as follows:

  1. On the Build History page, click in the upper right corner and select Make Template from the drop-down list.
  2. Enter the template name and description, and click Save.
  3. Click the username, and select All Account Settings from the drop-down list.
  4. In the navigation pane, choose Build > Templates. The saved template is displayed in the list.

    You can perform the following operations on saved templates.

    Table 2 Managing custom templates

    Operation

    Description

    Search for a template

    Enter a keyword in the search box to search for a template.

    Favorite a template

    Click to add the template to your favorites.

    Delete a template

    Click . In the displayed dialog box, click Yes to delete the template.

    You can only delete templates that you have created yourselves.

Creating a Service Endpoint

When you select any third-party repository on the Basic Information page, the Endpoint is a mandatory setting.

Service endpoints are extensions or plug-ins of CodeArts and provide the capability of connecting to third-party services.

By default, CodeArts Build pulls code from CodeArts Repo for your build. CodeArts Build also uses service endpoints to connect to third-party repositories to obtain project source code.

  • The network may be unstable or other problems may occur when a third-party repository is used.
  • Use the code import function of CodeArts Repo for secure, stable, and efficient download and build.

GitHub

To restrict CodeArts Build from accessing the GitHub repository, you can use OAuth or access token for authentication, as long as the code can still be pulled to complete the build.

You can also delete connections or withdraw authorization at any time to prevent password leakage.

  1. Click Create next to Service Endpoint.
  2. In the displayed dialog box, configure the following parameters.

    Parameter

    Description

    Service Endpoint Name

    Assign a custom name to the service endpoint. Enter a maximum of 256 characters, including letters, digits, hyphens (-), underscores (_), periods (.), and spaces.

    Authentication Mode

    • OAuth: You need to log in to GitHub for manual authorization.
    • Access token: If you select Access token as the authentication mode, you need to enter a GitHub access token. You can obtain the access token as follows:
    1. Log in to GitHub and open the configuration page.
    2. Click Developer settings.
    3. Choose Personal access tokens > Generate new token.
    4. Verify the login account.
    5. Enter the token description, select permissions, select the private repository access permission, and click Generate token.

    6. Copy the generated token.
      NOTE:
      • Save the token once it is generated. The token is invisible after you refresh the page. You can only generate a new token.
      • Enter a valid token description so that it can be easily identified. If the token is deleted by mistake, the building will fail.
      • Delete the token when it is no longer used to prevent information leakage.
  3. After the authorization is successful, return to the page for creating the build task.

Git

  1. Click Create next to Service Endpoint.
  2. In the displayed dialog box, configure the following parameters.

    Parameter

    Description

    Service Endpoint Name

    Assign a custom name to the service endpoint. Enter a maximum of 256 characters, including letters, digits, hyphens (-), underscores (_), periods (.), and spaces.

    Git Repository URL

    Enter the HTTPS address of the target Git repository.

    Username

    Optional. Enter the username of the target Git repository. Max. 300 characters.

    Password or Access Token

    Optional. Enter the password of the target Git repository. Max. 300 characters.

  3. Click OK.