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

Add template function for returning the path to the pack's directory #574

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josegonzalez
Copy link

@josegonzalez josegonzalez commented Aug 22, 2024

Description

When distributing a pack, it is common to wish to ship larger config files as part of a pack in separate files. This allows for better readability, as well as ensuring users can fallback on syntax highlighting from their editors when working on those files.

Reminders

  • Add CHANGELOG.md entry

Usage:

      template {
        data        = <<EOF
[[ fileContents (list (packPath) "templates/configs" "file-name.txt" | join "/") ]]
EOF
        destination = "${NOMAD_TASK_DIR}/file-name.txt"
      }

@josegonzalez josegonzalez changed the title feat: add template function for reading files from the pack templates directory Add template function for reading files from the pack templates directory Aug 22, 2024
@josegonzalez josegonzalez changed the title Add template function for reading files from the pack templates directory Add template function for returning the path to the pack's directory Aug 22, 2024
@josegonzalez josegonzalez force-pushed the pack-filecontents branch 2 times, most recently from ff2de47 to 2fa2ba7 Compare August 22, 2024 00:42
…ctory

This allows users to read the fileContents of files within the pack folder, making templating out larger files less inconvenient and allowing users to use syntax highting from their editors when working on said files.
@josegonzalez
Copy link
Author

Is there anything I need to do to get this merged?

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

Successfully merging this pull request may close these issues.

2 participants