Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

(GH-145) Add ability to tar.gz a given template #160

Merged
merged 1 commit into from
Jul 30, 2021
Merged

(GH-145) Add ability to tar.gz a given template #160

merged 1 commit into from
Jul 30, 2021

Conversation

sanfrancrisko
Copy link

@sanfrancrisko sanfrancrisko commented Jul 28, 2021

This commit adds the build method, which will take a given
template path and output dir, and generate a .tar.gz of the
template path's contents.

This work is built upon the previous effort in GH-137 which
implemented the TAR and GZIP utility methods.

Some preflight sanity checks are performed on the template path
to ensure it meets the minimum requirements of a PCT:

  • Are we in a valid module's root dir?
  • Does the directory path exist?
  • Does it contain a pct-config.yml at root?
  • Does it contain a content dir at root?

If those conditions are satisfied, the template directory is
first TAR'd and then GZIP'd, and the resulting .tar.gz output to
the specified directory.

If any operation fails along the way (pre checks / TAR/GZ operation),
an error is returned.

Closes: #145

@sanfrancrisko sanfrancrisko added the enhancement New feature or request label Jul 28, 2021
@sanfrancrisko sanfrancrisko requested a review from a team July 28, 2021 12:50
@sanfrancrisko sanfrancrisko self-assigned this Jul 28, 2021
@jpogran
Copy link
Contributor

jpogran commented Jul 28, 2021

Nit: As is, this technically does not introduce a build package, it introduces a package called template.

@sanfrancrisko sanfrancrisko marked this pull request as ready for review July 29, 2021 13:11
This commit adds the `build` package, which will take a given
template path and output dir, and generate a .tar.gz of the
template path's contents.

This work is built upon the previous effort in GH-137 which
implemented the TAR and GZIP utility methods.

Some preflight sanity checks are performed on the template path
to ensure it meets the minimum requirements of a PCT:

- Are we in a valid module's root dir?
- Does the directory path exist?
- Does it contain a `pct-config.yml` at root?
- Does it contain a `content` dir at root?

If those conditions are satisfied, the template directory is
first TAR'd and then GZIP'd, and the resulting `.tar.gz` output to
the specified directory.

If any operation fails along the way (pre checks / TAR/GZ operation),
an error is returned.
@da-ar da-ar merged commit 9e04371 into puppetlabs-toy-chest:main Jul 30, 2021
@sanfrancrisko sanfrancrisko deleted the GH-145/main/template_pkg branch July 30, 2021 12:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement build business logic method
3 participants