Allow global, user-defined override of CI templates location referenced via include:template
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
In %11.7 the include:template feature was introduced (gitlab-ce#53445). include:template enables users to easily reference a set of blessed .gitlab-ci.yml templates that ship with gitlab.
Currently, the location of these blessed templates is not configurable and users can only select from those shipped with GitLab itself.
We should make the location of these templates configurable the same way that the instance template repository is configurable.
Target audience
- Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha
- Devon, DevOps Engineer, https://design.gitlab.com/research/personas#persona-devon
- Sam, Security Analyst, https://design.gitlab.com/research/personas#persona-sam
Proposal
Add a new configuration section to /admin/application_settings/templates that enables selecting a local Project + optional subdirectory path.
When set, the value of [group/]<project>[/subdirectory/path/] is used to set the location of CI templates that may be referenced using the include:template property.
example
Configuration options of:
- group = templates
- project = ci-templates
- 
subdirectory = /(default)
Contents of templates/ci-templates repository:
.
└── Nodejs-library.gitlab-ci.yml## Nodejs-library.gitlab-ci.yml
.node10:
  image: node:dubnium
  before_script: node -p process.versionContents of my-libraries/library repository:
.
└── .gitlab-ci.yml## .gitlab-ci.yml
include:
  - template: Nodejs-library.gitlab-ci.yml
job:
  extends: .node10
  script: node -p '"hello world"'Links / references
- include:template
- gitlab-ce#53445
- default templates that ship with GitLab