Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support multiple templates in a single git repostory #1078

Closed
WolverineFan opened this issue Apr 5, 2023 · 1 comment
Closed

feat: Support multiple templates in a single git repostory #1078

WolverineFan opened this issue Apr 5, 2023 · 1 comment

Comments

@WolverineFan
Copy link

Is your feature request related to a problem? Please describe.
I would love to be able to put multiple templates in a single git repository. Currently, when I reference a git URL to run Copier it only seems to find a copier.yml file in the root directory of the repo.

Describe the solution you'd like
Ideally I would like to be able to reference a path to the template root from the command-line. Given a repo structure like this:

.
├── .git
├── template_1
│   ├── copier.yml
│   ├── file.txt
│   └── template.txt.jinja
├── template_2
│   ├── copier.yml
│   ├── dynamic.txt.jinja
│   └── static.txt
└── template_3
    ├── copier.yml
    ├── sample.yaml
    └── template.yaml.jinja

I can think of two common patterns that could work:
copier --vcs-ref HEAD git@github.com:DeloitteHux/hux-k8s-cd-cdm-template.git//template_1 /path/to/render
copier --vcs-ref HEAD --template-root template_1 git@github.com:DeloitteHux/hux-k8s-cd-cdm-template.git /path/to/render

Describe alternatives you've considered
Multiple repositories, which is fine to a degree, but there are use-cases where we want a single repo with multiple templates.

@yajo
Copy link
Member

yajo commented Apr 6, 2023

This is answered in the docs: https://copier.readthedocs.io/en/latest/configuring/#subdirectory

Duplicate of #315

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants