Introducing Chef Taste to Taste Your Cookbooks
Chef::Taste – What is it?
Chef Taste is a simple command line utility to check a cookbook’s dependency status. It will list the dependent cookbooks in a tabular format with the version information, status, and the changelog (if possible) for out-of-date cookbooks.
Inspiration
The Gemnasium project does a similar job for checking a Ruby project’s dependencies and keep them up-to-date. Chef-Taste is similar to that instead it provides a simple command line utility to list the dependency status for Chef cookbooks.
What it does?
When you are inside the cookbooks directory, simply type taste
to taste the cookbook.
The metadata.rb
of the cookbook is parsed to obtain the dependencies. It will display
a table that contains the following rows:
Name
– The name of the cookbookRequirement
– The version requirement specified in the metadataUsed
– The final version used based on the requirement constraintLatest
– The latest version available in the community siteStatus
– The status of the cookbook: up-to-date (a green tick mark) or out-of-date (a red x mark)Changelog
– The changelog of out-of-date cookbooks if available.
The overall status will also be displayed in the bottom of the table.
Changelog
Most of the cookbooks are hosted in Github and are tagged for every release. The changelog is computed by obtaining the source URL provided in the community site and finding the tags being used and the latest tag and displaying a compare view that compares these two tags. This URL is then shortened using goo.gl URL shortener to fit the table.
The details are obtained only for cookbooks available in the community site. Other cookbooks are
displayed but will simply have N/A
in their details.
Examples
These examples are based on the cookbooks available in the test/cookbooks
directory
in this repository.
1. fried_rice cookbook
1 2 3 4 5 6 7 8 9 10 |
|
2. noodles cookbook
1 2 3 4 5 6 7 8 9 |
|
3. curry cookbook
1 2 3 4 5 6 7 8 9 10 |
|
4. water cookbook
1 2 |
|