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

Ignore templating some file or directories #167

Open
vDMG opened this issue Mar 6, 2024 · 3 comments · May be fixed by #184
Open

Ignore templating some file or directories #167

vDMG opened this issue Mar 6, 2024 · 3 comments · May be fixed by #184
Labels
enhancement New feature or request

Comments

@vDMG
Copy link

vDMG commented Mar 6, 2024

First, thanks for open-sourcing this super cool project !

Describe the solution you'd like
We need a method to disable the templating for certain files/folders, especially when dealing with components like Helm chart templates that already include Go templates. In such cases, we don't want boilerplate to template them; instead, we need to output them as-is.

Describe alternatives you've considered
Not sure there is a clean way to do this but I found this workaround :

hooks:
  after:
  # copy helm templates (necessary because of go templates conflicts)
  - command: cp
    args:
      - -R
      - 'charts/{{"{{"}}.serviceName{{"}}"}}/templates/'
      - "{{ outputFolder }}/charts/{{ .serviceName }}/templates/"
  # copy github action files (necessary because of go templates conflicts)
  - command: cp
    args:
      - -R
      - ".github/workflows/"
      - "{{ outputFolder }}/.github/workflows/"

Additional context
I propose to add a property like disable_templating or skip_templating to the boilerplate manifest working the same way skip_files works but instead of skipping them we just copy them as-is.

WDYT ? If you like this proposal i'd love to contribute to the project.

@vDMG vDMG added the enhancement New feature or request label Mar 6, 2024
@vDMG vDMG changed the title Ignore template rendering directory Ignore templating some file or directories Mar 6, 2024
@brikis98
Copy link
Member

brikis98 commented Mar 6, 2024

Did you try skip_files?

@vDMG
Copy link
Author

vDMG commented Mar 6, 2024

Did you try skip_files?

Yes, but skip_files ignores those files, and they do not appear in the rendered project. In my case, I want to disable templating, but I need them in the rendered project. So, I simply want to copy/paste them without attempting to template.

@brikis98
Copy link
Member

brikis98 commented Mar 6, 2024

Oh, I gotcha. Sorry, read too quickly, and misunderstood.

A skip_templating feature similar to skip_files makes sense to me! PR welcome.

rwittrick added a commit to w6k-dev/gruntwork-boilerplate that referenced this issue Jun 10, 2024
@rwittrick rwittrick linked a pull request Jun 10, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants