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

87 lines
3.6 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
2020-06-23 00:09:42 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/6861) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.6.
2019-02-15 15:39:39 +05:30
2021-09-04 01:27:46 +05:30
Custom project templates are useful for organizations that need to create many similar types of
[projects](../project/index.md).
Projects created from these templates serve as a common starting point.
2020-10-24 23:57:45 +05:30
2021-04-17 20:07:23 +05:30
## Setting up group-level project templates
2020-10-24 23:57:45 +05:30
2021-09-04 01:27:46 +05:30
To use a custom project template for a new project:
2020-10-24 23:57:45 +05:30
2021-09-04 01:27:46 +05:30
1. [Create a `templates` subgroup](subgroups/index.md).
1. [Add repositories (projects) to that new subgroup](index.md#add-projects-to-a-group),
as your templates.
1. Edit your group's settings to look to your _templates_ subgroup for templates:
2020-10-24 23:57:45 +05:30
2021-09-04 01:27:46 +05:30
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).
1. 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.
1. Select the **templates** subgroup.
2020-10-24 23:57:45 +05:30
### Example structure
2021-09-04 01:27:46 +05:30
Here's a sample group/project structure for project templates, for a hypothetical _Acme Co_:
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
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
2019-03-02 22:35:43 +05:30
2021-09-04 01:27:46 +05:30
Users can configure a GitLab group that serves as template source under a group's
**Settings > General > Custom project templates**.
2019-03-02 22:35:43 +05:30
2021-02-22 17:27:13 +05:30
NOTE:
2021-09-04 01:27:46 +05:30
GitLab administrators can [set project templates for an entire GitLab instance](../admin_area/custom_project_templates.md).
Within this section, you can configure the group where all the custom project templates are sourced.
If all enabled [project features](../project/settings/index.md#sharing-and-permissions)
(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](../project/settings/import_export.md).
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. -->