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

Normalize Bento templates #361

Merged
merged 3 commits into from
May 26, 2015
Merged

Normalize Bento templates #361

merged 3 commits into from
May 26, 2015

Conversation

fnichol
Copy link
Contributor

@fnichol fnichol commented May 26, 2015

This PR introduces a modified subcommand called normalize (formerly fix) which will validate each template and then runs it through packer 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.

fnichol added 2 commits May 26, 2015 10:23
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.
@fnichol fnichol self-assigned this May 26, 2015
@fnichol
Copy link
Contributor Author

fnichol commented May 26, 2015

@yzl Ready for a quick review.

@@ -69,10 +70,10 @@ class Options
},
argv: templates_argv_proc
},
fix: {

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.

Copy link
Contributor Author

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh gotcha - cool!

@yzl
Copy link

yzl commented May 26, 2015

lgtm

fnichol added a commit that referenced this pull request May 26, 2015
@fnichol fnichol merged commit 7b0d85d into master May 26, 2015
@fnichol fnichol deleted the normalize-bento-templates branch May 26, 2015 17:58
@fnichol fnichol removed their assignment May 26, 2015
@fnichol fnichol mentioned this pull request May 29, 2015
@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Improvement labels Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants