Deploying changes to different environments

Hi everyone,

Currently I have five environments spread out over three data centers, and I’m using one chef-server per DC. I’m trying to figure out a way to manage changes with Git and only deploy changes to one environment at a time for testing. I’m not sure if I should use cookbook versioning or if there’s a better way to do it.

In the past I had a chef-server per environment, so once changes were committed to the dev branch, jenkins would deploy these changes to the dev chef-server. However I’m not sure how to do this without having a dedicated chef-server per environment. Any ideas?


I’m not an expert on best practices for the environment management (I sometimes have similar questions) but my thought would be the cookbook version approach. If you have three envs (Dev, QA, Prod) and they each point to the same version (1.0) then you can roll out your new version (1.1) one environment at a time.

  • First point Dev to 1.1 (QA and Prod are still on 1.0)
  • do your verification
  • Then point QA to 1.1 (Prod is still on 1.0)
  • do your verification
  • Then point Prod to 1.1 (now they’re all on 1.1)

I would think typically that you would do that with multiple cookbooks, not just a single change your trying to push through the envs. In terms of git, each change to an env could be (and perhaps should be) a commit/PR to a file in the roles directory.