Atalanta/cucumber-chef — pull request #117 by pikesley (2013-04-10 17:01:23+00:00)
Title: Workflow experiment

This PR is really just intended to initiate a discussion around some ideas I have for workflow. So, get this:

At the moment, we have a [separate repo for our cucumber-chef stuff](https://github.com/theodi/cuke-chef). Our [features](https://github.com/theodi/cuke-chef/tree/master/features) live over there, our [site-cookbooks](https://github.com/theodi/cuke-chef/tree/master/site-cookbooks), our [Cheffile](https://github.com/theodi/cuke-chef/blob/master/Cheffile), the whole thing.

And this feels like a bit of a non-DevOps silo. My thinking is that I would really like to run a cucumber-chef test-lab _per-project_, but use the cookbooks, environments etc from the existing repo (because these will be common across projects). So I would add _cucumber-chef_ to the Gemfile of some-project and bundle it, then do

cucumber-chef init
cucumber-chef create some-project.feature

then fix up the Labfile and construct the feature as required, and

cucumber-chef setup
cucumber

which I guess will run _all_ of the tests in that project, from the ground up, which strikes me as a Good Thing.

This PR represents my first cut at actually implementing this. We need to specify the location from which we'll pull the cookbooks, so we can now do things like this in `.cucumber-chef/config.rb`:

chef.merge!(
:cookbook_paths => [
"~/Github/cuke-chef/cookbooks",
"~/Github/cuke-chef/site-cookbooks"
],
:environment_paths => [
"~/Github/cuke-chef/environments"
],
:role_paths => [
"~/Github/cuke-chef/roles"
]
)

which [client.rb can now understand](https://github.com/theodi/cucumber-chef/blob/workflow-experiment/lib/cucumber/chef/client.rb#L54-L77) via [this in config.rb](https://github.com/theodi/cucumber-chef/blob/workflow-experiment/lib/cucumber/chef/config.rb#L184-L185)

I'm now thinking, however, that further abstractions could be made and we could just have something like

chef.merge!(
:chef_repo_path => "~/Github/cuke-chef/"
)

and work it all out from there.

So at the moment, I have this working for a very simple case.

Things to think about:

* I'm currently not handling data bags but that could be done in the same way
* We'd also want to merge in any stuff local to the project (particularly a project-specific role, I guess). My current implementation of this a bit crufty.

Does anybody else think this idea has legs? Is there something I've not thought of that's going to bite me on the bum?