-
Notifications
You must be signed in to change notification settings - Fork 52
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 post sync ability to rename files #250
Comments
hey @Boojapho , thanks for submitting! I think what you are describing is currently where vendir stops and expects a following tool to do what you are describing. At least how I view vendir's role in a workflow. The purpose of vendir is to sync a directory to match a remote / local location. The functionality you are describing moves slightly beyond that, to modifying the syncronized bits to rename them or modify them in some way. Could you describe why another tool that takes this directory as an input could not have this wildcard like behaviour instead of vendir? |
I had similar needs, and have also had needs to apply a local |
I'd also welcome it if there was a way to apply patch files through a post sync hook. Ideally it should just take regular patch files and apply them, ux could ideally be compatible with how https://linux.die.net/man/1/patch takes patches. |
I'm on the same boat. Have you been able to make some sort of progress or workaround on this? |
We've managed to add full vendir lock file maintenance support to renovatebot. Renovate now runs all of our Executing patches to the vendored files could probably be done with a renovate post upgrade task. But we haven't gotten around to experimenting with that part yet. But all of that doesn't mean that an integrated patch file support in vendir wouldn't be welcome still, to come full-circle with vendoring. |
I've a similar need and would love to see the ability to define hooks that run shell commands or scripts. Something like this would be awesome: apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
## ...
hooks:
post-sync:
# Define a script
- 'my-post-sync-script.sh'
# Or any other command
- 'ln -s vendir/confshare/.pre-commit-config.yaml .pre-commit-config.yaml' Currently we have comments in your |
Describe the problem/challenge you have
Sometimes syncs include files that have versions in the names of the files, which may be undesirable. If I sync a
githubRelease
withsample-v1.2.3-linux-amd64.tar.gz
and extract a file namedsample-v1.2.3
, I may want to rename this to justsample
so my binary matches what I had previously.Describe the solution you'd like
In the spec, I'd like to see an option for renaming files after they are downloaded, and use wildcards/grouping for the source
This would take all files named
sample-v*
and rename it tosample
. If more than one file matches, the behavior is indeterministicAnything else you would like to add:
For flexibility, the
from:
should support globs and regex so the user could craft it to match what is needed. In addition, you may want to include group substitution in theto:
so you could replace with a match in the regex.Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
The text was updated successfully, but these errors were encountered: