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

Allow management of arbitrary files like modulesync does #115

Open
genebean opened this issue Oct 7, 2019 · 7 comments
Open

Allow management of arbitrary files like modulesync does #115

genebean opened this issue Oct 7, 2019 · 7 comments
Labels

Comments

@genebean
Copy link

genebean commented Oct 7, 2019

PDKSync should allow for this as it is a function of modulesync that I no longer have access to due to the PDK also using a file names .sync.yaml for its configuration.

I use this functionality to maintain a templetized version of files not edited by the PDK.

Sent with GitHawk

@genebean
Copy link
Author

genebean commented Oct 7, 2019

The specific use cases I have are:

  • A templated version of .sync.yaml so that I don’t have to manually maintain the same settings in each repo. Currently, I have to do the following in each repo by hand:
    • enable the github_changelog_generator gem with all the associated settings (ref, condition, etc.)
    • enable puppet-strings tasks
    • enable coverage reports
    • enable mock with rspec
    • disable unneeded ci configs
  • a templated version of LICENSE
  • a templated Vagrantfile

Sent with GitHawk

@nmaludy
Copy link

nmaludy commented May 4, 2020

+1 we need this too

@DavidS
Copy link
Contributor

DavidS commented May 5, 2020

When we set out to build the pdk-templates, the thought was that folks with additional needs like this will fork pdk-templates, add their additionally required files and defaults, and regularly pull in from pdk-templates#master (or whatever tag matching their PDK version they're running).

Would this work for you?

@genebean
Copy link
Author

genebean commented May 5, 2020

When we set out to build the pdk-templates, the thought was that folks with additional needs like this will fork pdk-templates, add their additionally required files and defaults, and regularly pull in from pdk-templates#master (or whatever tag matching their PDK version they're running).

Would this work for you?

IMO, no. I don't want to add work to my plate by having to manually track changes in pdk-templates. My goal is not to diverge from the templates provided by Puppet but rather supplement them. In the scenario described in this issue I would not have to spend cycles tracking upstream changes, I'd just have to keep my site-specific data up-to-date. Generally speaking, the PDK and its associated templates are updated much more often than my site-specific data / configs / files.

@cdenneen
Copy link

@DavidS This is something I basically discussed back in 2018 with @bmjen and the preference I believe would be to allow for a similar config_defaults.yml which in turn would allow for these changes to be placed into the managed modules... and then if you needed to override from there an individual one off module could have a .sync.yml to override that single behavior...

so for example you could set in the config_defaults.yml that in spec/spec_helper.rb you wanted minimum_coverage of 95 but there is one module you know won't meet that so you'd either nil it in that single modules .sync.yml or change it to a value you know would pass... similarly with other settings that get applied down...

So its' like pdk-templates has it's defaults... the pdksync has defaults override those... and then the module has .sync.yml to be the final override.

@genebean
Copy link
Author

The overwhelming desire for this has resurfaced for me too as I have started another round of work on modules

@logicminds
Copy link
Collaborator

logicminds commented Sep 3, 2021

I was also wanting this. Ended up putting this in my CI file. This will find all directories and put files using cp or rsync


# pre setup and command
mkdir managed_files
# files you want to managed
cp .gitlab-ci.yml managed_files/
cp .sync managed_files/
# -r copies the directory, so specifying hidden and normal files here
find modules_pdksync -mindepth 1 -maxdepth 1 -type d -exec cp -v managed_files/.* {}/ \;`
find modules_pdksync -mindepth 1 -maxdepth 1 -type d -exec cp -v managed_files/* {}/ \;`

or

# haven't actually tried this but it should work
find modules -mindepth 1 -maxdepth 1 -type d -exec rsync -av managed_files/  {}/ \;

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

No branches or pull requests

6 participants