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

Adds options to run littlechef outside of kitchen, fixes library usage #252

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

iashwash
Copy link

@iashwash iashwash commented Jan 2, 2016

Library usage was difficult since littlechef needed to be run within the kitchen working directory.

I added an option to specify the path to kitchen and to skip node data bag building. With this and assuming a repository with prebuilt berks path, littlechef can be invoked without knife being installed on the system.

I also updated the library usage example. It contained an old way to invoke the deploy_chef function, and I added a link to a more detailed working example of invoking littlechef (since you have to specify many env variables to get it to run).

Tested fix and library invocations manually. Added setting of the kitchen_path and current test suite passes. If you have advice for setting up additional test cases I would be much obliged.

Removes `gems` parameter from call to deploy_chef in README.md, as
it is no longer a valid parameter.
Added a kitchen-path option so fix can run outside of kitchen.
Added a skip-node-data-bag option to minimize knife requirements on
the provisioning box.
Library invocations work.
@tobami
Copy link
Owner

tobami commented Jan 10, 2016

This looks really great. Path to the kitchen was something has needed more robustness for a long time now.

As tests i would suggest one for each of the two new options --skip_node_data_bag, and --kitchen-path. You could test test_runner directly (as a library) instead of testing the fix command (which requires a subprocess and is slow).

@tobami
Copy link
Owner

tobami commented Jan 10, 2016

Btw., your "Simple example of using littlechef as a library" gist denotes how involved it still is to use it. Did you really need to set so many options?

A more simpler option would be to set in code the kitchen path and have a littlechef.cfg there. Or reading configuration from a ~/.littlechef.cfg.

@iashwash
Copy link
Author

Thanks for the feedback. I'll add the additional tests this week (I found another issue with the node files that I'll be pushing up a fix for now).

You make a good point about how involved the example is, and I didn't think about just dropping in the config even for just library usage. Let me play with that as well and see if I can get rid of the complicated gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants