Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

Berkflow Chef Tool

A Cookbook-Centric Deployment workflow tool

Install & Usage Instructions

Berkflow

A command line tool for managing Chef Environments using Berkshelf and the Environment Cookbook Pattern.

TLDR of the Environment Cookbook Pattern; You have one top level cookbook that is locked to a Chef Environment. One application per Chef Environment. This Chef Environment is named {application_name}-{environment} (i.e. "myface-dev").

Requirements

Installation

Install the Chef-DK and add it, and it's gem binaries directory to your path

$ export PATH=/opt/chefdk/bin:$HOME/.chefdk/gem/ruby/2.1.0/bin:$PATH

Install Berkflow into the ChefDK

$ chef gem install berkflow
$ which blo
/Users/reset/.chefdk/gem/ruby/2.1.0/bin/blo

Usage

$ blo help

Upgrading a Chef Environment

Berkflow exposes a command for configuring a Chef Environment to a specific Environment Cookbook version and running Chef Client on all nodes in that environment.

$ blo upgrade myface-dev myface 1.2.3
Applying cookbook locks to myface-dev...
Discovering nodes in myface-dev...
Running Chef Client on 10 nodes...
Successfully ran Chef Client on 10 nodes
Done. See berkflow_out/20140331172904 for logs.

You can also upgrade to the latest version of the cookbook found on the Chef Server by passing latest

$ blo upgrade myface-dev myface latest

or simply leaving the version blank

$ blo upgrade myface-dev myface

Your Chef Server must meet the following requirements:

  • The myface-dev environment must exist
  • Version 1.2.3 of the myface cookbook (and it's dependencies) must be uploaded to the server
  • Version 1.2.3 of the myface cookbook must have a Berksfile.lock. A cookbook having a Berksfile.lock is said to be an "Environment Cookbook"

Note: earlier versions of Berkshelf generated a chefignore file that included the Berksfile.lock. This will prevent your Berksfile.lock from being uploaded. Remove this line from the chefignore of your cookbook. This has been fixed in Berkshelf master and will ship with Berkshelf 3.0.

By default, the user you are logged into your current machine and your default id_rsa key will be used for SSH authentication. See the help menu for how to override SSH settings.

Running Chef Client on a Chef Environment

Berkflow has you covered if you just want to run Chef Client on all the nodes in your Chef Environment.

$ blo run_chef myface-dev
Discovering nodes in myface-dev...
Running Chef Client on 10 nodes...
Successfully ran Chef Client on 10 nodes
Done. See berkflow_out/20140331180610 for logs.

Running shell commands on a Chef Environment

Running arbitrary shell commands is possible, too!

$ blo exec myface-dev "ls -lah"
Discovering nodes in myface-dev...
Executing command on 10 nodes...
Successfully executed command on 10 nodes
Done. See berkflow_out/20140331180708 for logs.

Shell commands executed with blo exec are by default not run with sudo. Use the --sudo flag to elevate.

$ blo exec myface-dev "ls -lah" --sudo

Installing Berkshelf packages into a Chef server

Packages generated by berks package can be easily installed into a Chef Server with Berkflow.

$ blo install https://github.com/berkshelf/berkshelf-cookbook/releases/download/v0.3.1/cookbooks.tar.gz

It works with filepaths, too

$ blo install cookbooks.tar.gz

Installing a package will upload and freeze each cookbook into your configured Chef Server. Already frozen cookbooks
will be skipped unless you specify the --force flag.

$ blo install cookbooks.tar.gz --force

Contributing

  1. Fork it ( https://github.com/reset/berkflow/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Author

Jamie Winsor (jamie@vialstudios.com)