debian-mirror-gitlab/doc/user/group/custom_project_templates.md
2021-09-04 02:52:04 +05:30

3.6 KiB

type stage group info
reference Manage Import To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments

Custom group-level project templates (PREMIUM)

Introduced in GitLab Premium 11.6.

Custom project templates are useful for organizations that need to create many similar types of projects. Projects created from these templates serve as a common starting point.

Setting up group-level project templates

To use a custom project template for a new project:

  1. Create a templates subgroup.

  2. Add repositories (projects) to that new subgroup, as your templates.

  3. Edit your group's settings to look to your templates subgroup for templates:

    1. In the left menu, select Settings > General. If you don't have access to the group's settings, you may not have sufficient privileges (for example, you may need developer or higher permissions).
    2. Scroll to Custom project templates and select Expand. If no Custom project templates section displays, make sure you've created a subgroup and added a project (repository) to it.
    3. Select the templates subgroup.

Example structure

Here's a sample group/project structure for project templates, for a hypothetical Acme Co:

# GitLab instance and group
gitlab.com/acmeco/
    # Subgroups
    internal
    tools
    # Subgroup for handling project templates
    websites
        templates
            # Project templates
            client-site-django
            client-site-gatsby
            client-site-hTML

        # Other projects
        client-site-a
        client-site-b
        client-site-c
        ...

Adjust Settings

Users can configure a GitLab group that serves as template source under a group's Settings > General > Custom project templates.

NOTE: GitLab administrators can set project templates for an entire GitLab instance.

Within this section, you can configure the group where all the custom project templates are sourced. If all enabled project features (except for GitLab Pages) are set to Everyone With Access, then every project template directly under the group namespace is available to every signed-in user. However, private projects are available only if the user is a member of the project. Also note that only direct subgroups can be set as the template source. Projects of nested subgroups of a selected template source cannot be used.

Repository and database information that are copied over to each new project are identical to the data exported with the GitLab Project Import/Export.