2

We're using Vagrant & Chef to provision the staging VM for our app.

Once I have a working cookbook, I upload it to chef-server and Jenkins hook ensures the staging env gets updated.

However, it's not clear to me how to try out the cookbook before I upload it. I can't use chef-solo because we're using environments.

Should I run a chef-server locally in a VM and upload it there? Or should I fix the cookbook versions in the run-lists and upload a new version (so that staging still uses the old one and does not break if the new version is wrong)?

How do you do this?

0

I suggest using Test Kitchen with the chef-zero provisioner.

There are several examples that use this:

To enable zero as the provisioner, put this in a .kitchen.yml

provisioner:
  name: chef_zero

You'll need to create mock environments, which you should create as JSON files in test/integration/environments.

Additional documentation about Test Kitchen is maintained by Chef Docs

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.