debian-mirror-gitlab/doc/user/group/custom_project_templates.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
3.3 KiB
Markdown
Raw Normal View History

2019-09-04 21:01:54 +05:30
---
type: reference
2020-06-23 00:09:42 +05:30
stage: Manage
group: Import
2021-02-22 17:27:13 +05:30
info: 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
2019-09-04 21:01:54 +05:30
---
2019-09-30 21:07:59 +05:30
# Custom group-level project templates **(PREMIUM)**
2019-02-15 15:39:39 +05:30
2021-12-11 22:18:48 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/6861) in GitLab 11.6.
2019-02-15 15:39:39 +05:30
2022-01-26 12:08:38 +05:30
When you create a project, you can [choose from a list of templates](../project/working_with_projects.md#create-a-project).
These templates, for things like GitLab Pages or Ruby, populate the new project with a copy of the files contained in the
template. This information is identical to the information used by [GitLab project import/export](../project/settings/import_export.md)
and can help you start a new project more quickly.
2020-10-24 23:57:45 +05:30
2022-01-26 12:08:38 +05:30
You can [customize the list](../project/working_with_projects.md#create-a-project) of available templates, so
that all projects in your group have the same list. To do this, you populate a subgroup with the projects you want to
use as templates.
2020-10-24 23:57:45 +05:30
2022-01-26 12:08:38 +05:30
You can also configure [custom templates for the instance](../admin_area/custom_project_templates.md).
2021-11-18 22:05:49 +05:30
2022-01-26 12:08:38 +05:30
## Set up group-level project templates
2021-09-30 23:02:18 +05:30
2022-01-26 12:08:38 +05:30
Prerequisite:
2020-10-24 23:57:45 +05:30
2022-04-04 11:22:00 +05:30
- You must have the Owner role for the group.
2020-10-24 23:57:45 +05:30
2021-09-30 23:02:18 +05:30
To set up custom project templates in a group, add the subgroup that contains the
project templates to the group settings:
1. In the group, create a [subgroup](subgroups/index.md).
1. [Add projects to the new subgroup](index.md#add-projects-to-a-group) as your templates.
2022-01-26 12:08:38 +05:30
1. In the left menu for the group, select **Settings > General**.
2021-09-30 23:02:18 +05:30
1. Expand **Custom project templates** and select the subgroup.
2022-01-26 12:08:38 +05:30
The next time a group member creates a project, they can select any of the projects in the subgroup.
2021-09-30 23:02:18 +05:30
2022-01-26 12:08:38 +05:30
Projects in nested subgroups are not included in the template list.
## Which projects are available as templates
- Public and internal projects can be selected by any signed-in user as a template for a new project,
if all [project features](../project/settings/index.md#sharing-and-permissions)
except for **GitLab Pages** and **Security & Compliance** are set to **Everyone With Access**.
- Private projects can be selected only by users who are members of the projects.
2020-10-24 23:57:45 +05:30
2022-01-26 12:08:38 +05:30
## Example structure
2020-10-24 23:57:45 +05:30
2022-01-26 12:08:38 +05:30
Here's a sample group and project structure for project templates, for `myorganization`:
2020-10-24 23:57:45 +05:30
2021-04-17 20:07:23 +05:30
```plaintext
2020-10-24 23:57:45 +05:30
# GitLab instance and group
2022-01-26 12:08:38 +05:30
gitlab.com/myorganization/
2020-10-24 23:57:45 +05:30
# Subgroups
internal
tools
# Subgroup for handling project templates
websites
templates
# Project templates
client-site-django
client-site-gatsby
2022-01-26 12:08:38 +05:30
client-site-html
2020-10-24 23:57:45 +05:30
# Other projects
client-site-a
client-site-b
client-site-c
...
```
2019-09-04 21:01:54 +05:30
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->