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

Treat purge_whitelist as globs, not fixed filenames #169

Closed
wants to merge 1 commit into from
Closed

Treat purge_whitelist as globs, not fixed filenames #169

wants to merge 1 commit into from

Conversation

raphink
Copy link
Contributor

@raphink raphink commented Aug 19, 2020

For example, .resource_types content is purged without this (the directory is ignored, but every file in it is purged).

@xorpaul
Copy link
Owner

xorpaul commented Aug 19, 2020

Hmm, if I'm remembering it correctly, using globs made it difficult to also purge matching files inside sub-directories.

purge_whitelist: [ '.resource_types/*.pp' ]
Would not delete

└── foo
    └── bar.pp

But I could be wrong.

I'll have to test this again, your glob solution would make more sense to be honest.

@raphink
Copy link
Contributor Author

raphink commented Aug 19, 2020

I don't see why this would happen with my implementation.

At the moment, it's not possible to avoid purging .resource_types content.

@raphink
Copy link
Contributor Author

raphink commented Aug 20, 2020

Also, r10k supports globs so it would make sense for g10k to behave the same way.

@raphink
Copy link
Contributor Author

raphink commented Aug 21, 2020

@xorpaul Anything I can do to help decide on whether to merge this?

@xorpaul xorpaul self-assigned this Aug 21, 2020
@xorpaul xorpaul closed this in 3e38b95 Aug 21, 2020
xorpaul added a commit that referenced this pull request Aug 21, 2020
@xorpaul
Copy link
Owner

xorpaul commented Aug 21, 2020

I needed to adjust the tests to verify if the glob pattern really work.

I've also added github.com/yargevad/filepathx to support the recursive double star pattern.

---
deploy:
  purge_levels: ['deployment', 'puppetfile', 'environment']
  purge_whitelist: [ '.latest_revision', '.resource_types', 'resource_types/*.pp', '**/*.pp'. ]
  deployment_purge_whitelist: [ 'example_hiera_*', '.resource_types' ]

sources:
  example:
    remote: 'https://github.com/xorpaul/g10k-environment.git'
    basedir: '/tmp/out/'
    prefix: true
  example_hiera:
    remote: 'https://github.com/xorpaul/g10k-hiera.git'
    basedir: '/tmp/out/'
    prefix: true

Check out the new release:
https://github.com/xorpaul/g10k/releases/tag/v0.8.12

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