Search code examples
chef-infraberkshelftest-kitchen

Distributing Cookbooks to Team Members


Using test-kitchen and Berkshelf, I'd like to capture & distribute my current cookbooks.

After telling teammates to install berkshelf, these options seem possible:

  1. retrieve cookbooks via the opscode repo per Berksfile cookbook
  2. run berks package to tar-ball all necessary cookbooks. Then, developers would unzip the tarball, then their Berksfile would retrieve each cookbook via cookbook X, path: 'cookbooks/X'
  3. ???

Which option is the best and why?


Solution

  • Why do you want to distribute the cookbooks? The entire point of tools like Berkshelf/Bundler is so that you don't have to share cookbooks.

    When you install your cookbooks with Berkshelf, Berkshelf will generate a lockfile. This lockfile contains the list of all the cookbooks and their location. Then you check in that lockfile to source control. When your teammates clone/update the repository, they will get that lockfile. When then run berks install, Berkshelf will honor all the constraints and versions from the lockfile.

    Non-standard locations (i.e. path, github, svn, hg, etc) are highly discouraged. They make solving the graph nearly impossible and make your repository less portable.

    See also:

    Sources:

    • Core team