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

Importing an External Repository

You can import a cloud repository to CodeArts Repo or import a CodeArts Repo repository from a region to another region (see Repository Backup). The imported repository is independent of the source repository.

Currently, this function is not supported at AP-Singapore. Check your access point (AP) in the upper left corner.

  1. Log in to the Console, click in the upper left corner of the page, search for CodeArts Repo, click , the repository list page is displayed.
  2. Click New repository. The Project and Repository Type page is displayed. Select an existing project or click Create Project from the Project drop-down list box.

    • The code repository must be in a project. You can view the repository dashboard by project.
    • If the account does not have a project, click Create Project in the drop-down list box to create a Scrum or an IPD-Self-Operated Software/Cloud Service project.
    • If you create a repository in a project, the project is selected for Project by default, and the Project parameter is hidden on the repository creation page.

  3. Set Repository Type to Import. The Import Repository page is displayed.

    • The source repository port can be 80, 443, or greater than 1024.
    • Supported: Git and SVN. If the import using other types of source repositories fails, contact technical support to check the source server whitelist.

  4. Click Next. On the Create Repository page, set the parameters by referring to Table 1 and Table 1.

    Table 1 Parameters for synchronizing the repository

    Parameter

    Mandatory

    Remarks

    Branch

    Yes

    You can choose to synchronize the default branch or all branches of the source repository.

    Schedule

    No

    You can synchronize branches manually. In addition, you can also schedule synchronization. This setting cannot be changed after you configure it. If Schedule sync into repo is selected:

    • The default branch of the source repository is automatically imported to the default branch of the new repository every day.
    • The repository becomes a read-only image repository and cannot be written. In addition, only the branches of the third-party repository corresponding to the default branch of the current repository are synchronized.

    You can synchronize branches manually. In addition, you can also schedule synchronization. This setting cannot be changed after you configure it. For details, see Repository Synchronization

  5. Click OK to import the repository. The repository list page is displayed.
  • The timeout interval for importing a repository is 30 minutes. If the import times out, use the clone/push function on the client.
  • The Git LFS object is not imported.
  • The repository domain must be connected to the service node.

Obtaining an Access Token

  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 a token description, select permissions, select the private repository access permission, and click Generate token.

  6. Copy the generated token to CodeArts Repo.

    • 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 to prevent build failures caused by mis-deletion.
    • Delete the token when it is no longer used to prevent information leakage.