Help Center> CodeArts Repo> User Guide> Old Version> Cloud Repository Creation> Creating a Repository Using a Template
Updated on 2023-07-25 GMT+08:00

Creating a Repository Using a Template

You can create a repository using a CodeHub template on the CodeHub console.

Prerequisites

This operation must be performed in the Scrum template project.

Procedure

  1. Access the repository list page.
  2. Click next to Create Directly and select Use Template from the drop-down list. The Template Repository page is displayed.
  3. On the Template Repository page, enter a keyword for fuzzy search and select a template as required.
  4. Click Next. On the Create Repository page, enter basic repository information.

    Table 1 Parameters for creating a repository using a template

    Parameter

    Mandatory

    Remarks

    Repository Name

    Yes

    A name contains letters, digits, underscores (_), periods (.), and hyphens (-) and must start with a letter, digit, or underscore (_).

    Project

    Yes

    • A repository must be in a 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.

    Description

    No

    Enter the description of your repository.

    Permissions

    No

    The options are as follows:

    • Allow project members to access the repository.

      The project manager is automatically set as the repository administrator, and the developer is set as a common repository member. When members of the two roles are added to the project, they are added to the repository member list by automatic synchronization. You can view the list.

    • Allow automated creation of a code check task.

      After the repository is created, you can view the code check task of the repository in the CodeCheck task list after switching to the region where the repository is located.

    Visibility

    Yes

    The options are as follows:

    • Private

      The repository is visible only to repository members. Repository members can access the repository or commit code.

    • Public read-only

      The repository is open and read-only to all guests, but is not displayed in their repository list or search results. You can select an open-source license as the remarks.

  5. Click OK to create the repository.
  6. After the repository is created, the repository list page is displayed.

When you create a repository by template, the repository type of the selected template will be automatically configured for the repository.

The repository created using the template contains the repository file structure preset in the template.

Automatically Creating a Pipeline

A pipeline can be automatically created when a repository is created using a template. Note that the host used in CloudDeploy must be changed to the actual environment so that the pipeline can be successfully executed.

  1. On CodeHub, click next to Create Directly and select Use Template.
  2. On the Use Template page, set Automated Pipeline Creation to Yes in the navigation pane to display templates that can be used to automatically create a pipeline.

  3. Select a template as required, click Next, enter basic repository information, and click OK.
  4. After the repository is created, you can view the pipeline that is automatically created on the pipeline list page displayed.