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

Support multiple outputs based on platform/test suite variables (issue 121) #122

Merged
merged 1 commit into from
Dec 2, 2016

Conversation

jcastillocano
Copy link

Hi,

in order to workaround issue #121 we came up with this implementation: support template format for verifier.output parameter. Right now only platform and suite are supported, but it easy to add more parameters if they are needed.

Default output is not modified, as well as custom path option. The only behavior updated here is when you define the output as format string (%{}), so given platform or suite flags they will be replace (in that way, you can specify an output value in the general verifier section, but multiple inspec files will be created based on the flags.

Added unit test and README block explaining this feature.

Thanks @AgarFu for your help!

@AgarFu
Copy link

AgarFu commented Dec 1, 2016

👍

@chris-rock
Copy link
Collaborator

@jcastillocano Great work. This PR implicitly manifest the decision that we are using the sprintf method of Ruby https://ruby-doc.org/core-2.2.0/String.html#method-i-25 instead of any ERB templates. I think that is working well, since yml have key-value pairs only.

Could you do me one favor and squash the commits?

Signed-off-by: Juan Carlos Castillo Cano <juancarlos_castillocano@intuit.com>
@jcastillocano
Copy link
Author

Thanks @chris-rock!

@chris-rock chris-rock merged commit c1f4302 into inspec:master Dec 2, 2016
@florian-asche
Copy link

Would be cool to have "instance" also as possible parameter. If you use kitchen-list and create a loop for that data in jenkinsfile you cannot use suite/platform because of different names. Dots will be removed and - to _. Instance should be correct.

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.

5 participants