-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Normalize Bento templates #361
Conversation
The normalize subcommand does 2 things: 1. Run `packer validate` to verify the integrity of the template 2. Run `packer fix` to normalize the JSON format for a higher degree of consistency A summary of all changes templates are printed at the end of the normalize execution, making this command useful in CI.
@yzl Ready for a quick review. |
@@ -69,10 +70,10 @@ class Options | |||
}, | |||
argv: templates_argv_proc | |||
}, | |||
fix: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should deprecate/warn but not remove the 'fix' CLI command in favor of making it an alias of 'normalize' at least for a little while. I may be being more conservative than is needed though. I feel like as small as it is, it is technically a 'breaking' change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, the bin/bento
code has only been in master about a week (and still not documented). I could add an alias here, but was hoping it was under (or not) used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh gotcha - cool!
lgtm |
This PR introduces a modified subcommand called
normalize
(formerlyfix
) which will validate each template and then runs it throughpacker fix
to normalize the JSON output formatting. The subcommand creates a report at the end containing a list of all templates that were modified in the normalize execution, making this a candidate for running in CI.