Ohai chefs!
Glad to see that Chef-DK brings together the most commly used tools in the
chef community. Not only because they are now “officially recommended” but
also for the reduced likelihood of dependency conflicts (think of the json
gem). Sweet!
One thing I didn’t fully understand though: How is it intended to work with
different projects / cookbook repos that have different versions of
chefspec, foodcritic, test-kitchen, etc?
I probably can’t / don’t want to upgrade all my repos everytime a new
version of Chef-DK comes out. Is this coupling intended? The fact that it
bundles chefspec, foodcritic and test-kitchen makes it look like so…
From my experience with bills kitchen [0] (“all you need for cooking with
Chef on windows” - think of it as a more opinionated, windows-only
Chef-DK++) I went down the same path:
First I bundled not only Chef and Vagrant but also pre-installed loads of
related gems in a configuration that would not conflict with each other.
This got more and more painful every time a new version of one of the gems
(e.g. chefspec) came out. Upgrading the gem was a global operation and thus
affected all projects I was working with.
Since this was way too annoying I switched to another approach [1]:
- bills kitchen now only bundles Ruby (+DevKit), Chef and Vagrant
- bundler is the only pre-installed gem
- bindler [2] is the only pre-insalled vagrant plugin
All other gems (like berkshelf, chefspec, foodcritic, test-kitchen, etc)
and vagrant plugins (like vagrant-omnibus, vagrant-berkshelf, etc) are now
managed per project in a Gemfile or plugins.json respectively.
Having the core tools decoupled from the other gems gave me a great deal of
flexibility. I can now work on older projects as well as newer projects
using the same version of bills kitchen, and I’m no longer forced to
upgrade older projects just because of a newer version of bills kitchen.
Right now it seems to me that Chef-DK follows the approach to bundle
everything. Sure, you can still use Gemfiles in your projects, but wouldn’t
this end up in confusion due to the different Ruby installation (System
ruby vs. Chef-DK embedded ruby)?
What’s the intended usage of Chef-DK here?
Cheers,
Torben
[0] https://github.com/tknerr/bills-kitchen
[1] compare https://github.com/tknerr/bills-kitchen/blob/0.10/README.md
with master
[2] https://github.com/fgrehm/bindler