-
Notifications
You must be signed in to change notification settings - Fork 10
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 more functionality around dependency management and other tweaks #3
base: main
Are you sure you want to change the base?
Conversation
Updated the config struct to include some new properties that will allow a root configuration to list 'child' directories and a 'clean_pattern' which will give users some control over how tfgen will clean up templates.
Removed some of the logic in the function that searches parent directories. Moved that logic to its own function ('collateConfig') so it can be used by other functions, including the ones needed for the new command 'exec_all'.
New commands that will allow tfgent to delete files that were generated by a template. These commands expect a 'clean_pattern' to be defined, ideally in the root configuration to allow for the 'clean_all' command, which will clean the 'child_directories' defined in the root confing. This should give the user a great deal of control around how they want things cleaned up when needed.
Thew 'exec_all' command allows users to specify a directory where a root configuration is (this is required -- it errors out, otherwise). Then, tfgen will 'exec' as normal for any and all children directories that are defined by the root config.
Adding the new commands ('exec_all', 'clean', and 'clean_all') to main.
The term 'child_directories' might become confusing later on due to some other features that might be implemented. Going to change them to 'target_directories' which is a bit more in line with the original default behavior of tfgen and how it named/identified the 'targetDir'.
New Functionality & Concepts: Child Directories and Clean-Up
@linuxfreakus thank you for opening this PR! I still own you this review, I'm trying to find some time to do so. I promise I'll try to get back to you this weekend 😁 |
My thoughts regarding the added functionalities: Good ✅
Needs discussionDepsThe
|
Not sure how much you want to take pull requests but I found your repo, started using it and liked it... but also wanted more features so I added:
.tfgen.yaml
into a.tfgen.d
directory to make them easier to work on and have syntax highlighting, etc.deps
section to the yaml to declare providers and modules, and names of remote states that can be used to filter on when generating templates along with associated helper functions, etcThe code under the config.go could probably get broken up into some separate files since i added more structs for reading the yaml, but its not too terrible yet.