Blog-L_Generic_-1

Community-authored Plugin: Knife Community Release

Here at Opscode, we release a lot of cookbooks to the Chef Community site. Each individual cookbook is a separate software development project: they all have a git repository, a released “artifact” version, and as we extend cookbooks for test kitchen, tests.

We follow particular process for releasing new versions. Assuming first that the cookbook’s changes have been tested, we do the following:

  1. Update the version in the metadata.rb.
  2. Update the CHANGELOG.md with the changes.
  3. Create a commit for release, and git tag the repository.
  4. Release the new version on the community site.
  5. Push the git commit and tags to the GitHub repository.
  6. Update the metadata version to the next odd-numbered “patch” release for development (e.g., 1.0.2 -> 1.0.3).
  7. Commit the “development version” and push to GitHub.

With over 130 cookbooks maintained by Opscode, that can be a lot of repetition when we do a number of releases. This is even worse as I maintain 35 of my own cookbooks.

I lamented about not having a knife plugin to automate the process on twitter after releasing a cookbook where I forgot to push the commit with the metadata.rb change, and Mike Fiedler offered to write such a plugin. I drafted some thoughts, and today he released a RubyGem for a new knife-community plugin. After using this for a couple releases today, I can confirm it is totally awesome.

The plugin is hosted on GitHub.

Mike is working to implement additional features, including the “increment for development” steps (#6 and #7 above), and add more spec and integration tests. If you’d like to help out, you can contact him:

Thanks Mike!

Posted in:

Joshua Timberman

Joshua Timberman is a Code Cleric at CHEF, where he Cures Technical Debt Wounds for 1d8+5 lines of code, casts Protection from Yaks, and otherwise helps continuously improve internal technical process.

Join Automate for Good hackathon and be eligible to win $60000 in prizes
chefconf-banner
image_334

FOLLOW @CHEF