Bind a source code hosting platform

更新时间:
复制 MD 格式

To build images, you must first bind a source code hosting platform. This topic describes how to bind a Personal Edition instance to a source code hosting platform.

Prerequisites

Background information

Container Registry Personal Edition instances support the following source code hosting platforms:

Code platform

Platform version

Binding method

Build trigger limits

Codeup

All

personal access token

None

GitHub

GitHub personal account only

GitHub OAuth authorization

None

Bitbucket

All

Bitbucket OAuth authorization

None

GitLab

All

personal access token

None

Bind your personal instance to Codeup

  1. Create a personal access token for Alibaba Cloud Codeup.

    1. Log on to Codeup.

    2. On the Apsara Devops Codeup page, click your personal account and then click Personal Settings.

    3. In the navigation pane on the left of the Personal Settings page, click Personal access token.

    4. Click New Token. Set the Token Name and Expired At. Select the permissions to grant, and then click New. Read the Security Tip and then click OK, I understand the risks.

      The following list describes the least privilege required to create an access token.

      • Organization Management

        • Organization members: read-only

        • Organization departments: read-only

      • Code Management

        • Code repositories: read-only

        • Branches: read-only

        • Tags: read-only

        • Webhook: read/write

      After the token is created, it is displayed on the page.

      image

  2. Find your HTTPS clone username.

    In the left-side navigation pane of the Personal Settings page, click HTTPS Password to view your clone username.

  3. Bind your instance to Codeup.

    1. Log on to the Container Registry console.

    2. In the top navigation bar, select a region.

    3. In the left-side navigation pane, click Instances.

    4. On the Instances page, click the target Personal Edition instance.

    5. In the left-side navigation pane of the instance management page, choose Repository > Code Source.

    6. On the Code Source page, find Codeup and click Bind Account in the Actions column.

    7. In the dialog box that appears, set the parameters and click Confirm.

      • Endpoint: You do not need to set this parameter.

        Note

        When you bind a Codeup account, the system automatically detects the address.

      • Username: Enter the HTTPS clone username that you obtained in Step 2.

      • Personal access token: Enter the personal access token that you created in Step 1.

      On the Code Source page, a Bound status in the Actions column for Codeup indicates a successful binding.

Bind your personal instance to GitHub

  1. Log on to the Container Registry console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, click the target Personal Edition instance.

  5. In the left-side navigation pane of the instance management page, choose Repository > Code Source.

  6. On the Code Source page, find GitHub and click Bind Account in the Actions column.

  7. In the GitHub dialog box, click Go to the source code repository to bind account.

  8. On the GitHub sign-in page, enter your username and password, and then click Sign in.

  9. On the Authorize Aliyun Container Registry page, review the requested permissions and click Authorize AliyunDeveloper.

    Return to the Container Registry console. The message You have successfully linked your GitHub account is displayed, which indicates that the binding is successful.

Bind your personal instance to Bitbucket

  1. Log on to the Container Registry console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, click the target Personal Edition instance.

  5. In the left-side navigation pane of the instance management page, choose Repository > Code Source.

  6. On the Code Source page, find Bitbucket and click Bind Account in the Actions column.

  7. In the Bitbucket dialog box, click Go to the source code repository to bind account.

  8. On the Bitbucket page, enter your email address and click Continue. Then, enter your password and click Logon.

  9. On the Confirm access to your account page, review the permissions and click Grant access.

    Return to the Container Registry console. The page displays the message You have successfully bound your Bitbucket account, which confirms that the binding was successful.

Bind your personal instance to GitLab

If you use a self-managed GitLab instance, take note of the following port requirements when you bind your instance:

  • HTTP service

    Port 80 is used by default. If you use a different port, you must manually add the port number to the end of the trigger URL. Only the following ports are supported: 80, 21, 443, 70, 210, 280, 488, 591, 777, and 1025 to 65535.

  • HTTPS service

    Port 443 is used by default and is the only port supported for HTTPS. To use a non-default port, you must use the HTTP service.

Note
  • GitLab instances behind a firewall or that use a self-signed HTTPS certificate are not supported. Your GitLab instance must be accessible from the internet.

  • If you bind your Personal Edition instance to a GitLab repository that is in a subgroup, you can only manually trigger image builds.

  1. Create a personal access token in GitLab.

    1. Sign in to GitLab.

    2. On the GitLab page, click your user profile, and then click Settings.

    3. In the left-side navigation pane of the User Settings page, click Access Tokens.

    4. On the Access Tokens page, enter a name, set an expiration date, select the api scope, and then click Create personal access token.

      After the token is created, you can view it on the Access Tokens page.GitLab

  2. Bind your instance to GitLab.

    1. Log on to the Container Registry console.

    2. In the top navigation bar, select a region.

    3. In the left-side navigation pane, click Instances.

    4. On the Instances page, click the target Personal Edition instance.

    5. In the left-side navigation pane of the instance management page, choose Repository > Code Source.

    6. On the Code Source page, find GitLab and click Bind Account in the Actions column.

    7. In the dialog box that appears, set the parameters and click Confirm.

      • Address: Enter the sign-in URL of your GitLab instance.

        • If you use a self-managed GitLab instance, enter its sign-in URL.

        • If you use a public GitLab instance, enter its sign-in URL.

      • Username: Enter your GitLab username.

      • Personal Access Token: Enter the personal access token created in Step 1.

      On the Code Source page, a Bound status in the Actions column for GitLab indicates a successful binding.

Related topics

If the binding fails, refer to the following topic for troubleshooting: FAQ about source code repositories.