@JobV This should be doable, especially if there is a fixed location, and the company abides by some rules. For example, some files should be excluded like the README.md.
In the case of the gitignores, the repository is cloned and the content selected on the filename. All filename which end with .gitignore will make it to the dropdown. I'm afraid that someone won't read the docs and thinks its broken? @JobV What do you think?
Furthermore it would be helpful to force the usage of one of the pre-defined .gitlab-ci.yml. This is to protect the test- and deployment-process within a huge team of developers with different permissions.
We would love this feature! TeamCity makes nice use of templates. Jenkins Job DSL plugin makes it awesomely easy to edit any or all configurations. This would be a huge benefit to us and Gitlab EE. A common use case is if we spin up a new environment, or segment off an existing environment that all of our builds deploy to, to be able to edit all configs in one spot would be great. And it would put Gitlab CI even higher on the competitive market.
@JobV I don't understand how this feature would work, in practice.
Putting stuff in a folder inside a repository makes sense in the case of issues templates for instance, as issues will be created over and over.
.gitignore and LICENSE will likely be only created once. Setting up those templates should be made at the instance/group level, and chosen in a dropdown when we create a new project.
We can have those templates in a directory in the project itself. In that case, when we use the buttons to Set up CI or Add a license (as shown below), we can populate the dropdown in the screen that appears.
Problem
However, UX-wise, this assumes that users know that they have to add those templates in the first place in the project and follow a specific flow.
This is not obvious.
Most projects which don't have a .gitignore or a LICENSE are likely to be empty. If we use this folder method, they will have to copy the list of templates and paste them in the repository, then push to master, then they can use the templates. In that case, it's easier to simply create the file with the right template right from the start.
This is solved if you manage it at the group/instance level. It's also more work for us.
Proposal
We would need
a new settings panel at the instance level, and possibly the group level
a way to add multiple templates, give them a name and group them in categories (LICENSE, .gitignore or .gitlab-ci.yml)
change the screens (new/master?commit_message=Add+license&file_name=LICENSE) to populate the dropdowns of templates with custom templates if defined.
Régis Freyd (GitLab)changed title from Custom templates for .gitignore, .gitlab-ci.yml, LICENSE to eeeeeeeeeeeCustom templates for .gitignore, .gitlab-ci.yml, LICENSE
changed title from Custom templates for .gitignore, .gitlab-ci.yml, LICENSE to eeeeeeeeeeeCustom templates for .gitignore, .gitlab-ci.yml, LICENSE
Régis Freyd (GitLab)changed title from eeeeeeeeeeeCustom templates for .gitignore, .gitlab-ci.yml, LICENSE to Custom templates for .gitignore, .gitlab-ci.yml, LICENSE
changed title from eeeeeeeeeeeCustom templates for .gitignore, .gitlab-ci.yml, LICENSE to Custom templates for .gitignore, .gitlab-ci.yml, LICENSE
I would like to extend that idea to also allow creating custom categories. In my case I would like to create template for Marathon app configuration file. I can imagine other folks may want to "templetize" Kubernetes, Docker Compose, Cloudformation etc specific files.
@mydigitalself That issue doesn't seem to cover the case where you'd like to include only custom license files, or remove some of those. Do you know about another issue on this?
@jwoods06 was there an effort to identify custom templates? We have a common IDE used across multiple projects and we would like to be able to have it show up in the templates list.
Also - we would like to create a template for files_blacklist that can just be pulled up from the UI as a template. It seems that the only offered ones are the ones listed in this issue and Dockerfiles...