Updated on 2023-07-25 GMT+08:00

Creating a Repository Using a Template

You can create a repository using a CodeArts Repo template on the CodeArts Repo console.

Prerequisites

This operation must be performed in the Scrum template project.

Procedure

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

    Table 1 Parameters for creating a repository using a template

    Parameter

    Mandatory

    Remarks

    Repository Name

    Yes

    The name must start with a letter, digit, or underscore (_) and can contain periods (.) and hyphens (-), but cannot end with .git, .atom, or period (.). The name can contain a maximum of 200 characters.

    Project

    Yes

    • A repository must be associated with a project.
    • If there is no project under the account or you click Create Project in the Project drop-down list, the Create Project dialog box is displayed and you can create a basic project. (For a basic project, only CodeArts Repo and some services can be used. Other services are not enabled by default. You can change a project to a basic project on the project settings page.)
    NOTE:

    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 a description for your repository. The description can contain a maximum of 2,000 characters.

    Permissions

    No

    • 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.

    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

      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.

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 CodeArts Deploy must be changed to the actual environment so that the pipeline can be successfully executed.

  1. On CodeArts Repo, click next to New Repository and select Template Repository.
  2. On the Select 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.