Add code access permissions

更新时间:
复制 MD 格式

Code access permissions are a global setting in Cloud Build. Use this setting to grant access to your code repositories. After access is granted, you can pull code to build, compile, or perform other operations.

Background information

  • The following code repository types are supported: GitHub, Gitee, GitLab, Apsara DevOps Codeup, Bitbucket, Coding, and Generic Git.

  • The following protocols are supported: Secure Shell (SSH) and HTTPS.

Note

This topic uses GitLab as an example to describe how to add access permissions for a code repository.

Prerequisites

  • If you use the SSH protocol to access the code repository, you need to generate an SSH key. For more information, see Set an SSH Key.

  • If you use the HTTPS protocol to access the code repository, you need to obtain a token. For more information, see Obtain a security token.

Procedure

  1. On the Cloud Build console homepage, click Application Configuration in the navigation pane on the left. The Application Configuration pane appears on the right.

  2. On the Application Configuration page, select Code Source, configure Code Repository, and then click Code Access Permissions. The Add Repository Permission pane appears on the right.

    Note

    This procedure uses GitLab as an example code source. If you use a different code source, follow the instructions in the user interface.

  3. In the Add Repository Permission pane on the right, configure the parameters.

    Option

    Description

    Repository type

    Specifies the type of the code repository, including GitHub/Gitee/GitLab/Apsara DevOps Codeup/Bitbucket/Coding/Generic Git.

    Note

    • If you set Repository type to Generic Git, Access protocol supports only SSH.

    • If you set Repository type to any other option, Access protocol supports both SSH and HTTPS.

    Access protocol

    The protocol used to access the repository. The options are SSH and HTTPS.

    Repository domain name

    The domain name of the code repository. For example, gitlab.emas.com.

    Account

    The logon account for the code repository.

    SSH public key

    This parameter appears if you set Access protocol to SSH. Click Click here to generate an SSH public key. After the key is generated, double-click the key to copy it. Add the copied key to your code repository. For more information, see Set an SSH Key.

    Important

    The SSH public key is sensitive information. Keep it confidential.

    token

    This parameter appears if you set Access protocol to HTTPS. Enter the security token for the code repository. For more information about how to obtain a security token, see Obtain a security token.

    Important

    The token is sensitive information. Keep it confidential.

  4. After you configure the parameters, click Connection Test to verify the permissions.

  5. After the verification succeeds, click Save to save the access permissions for the code repository.