Helper to release cookbooks. This motivation is to publish new version at each commit on master branch from the CI.
This helper will create tags, push them and publish to supermarket.
cookbook-release reads commit messages since last release and suggest a new version accordingly.
The following table describes the word used to detect patch/minor/major version changes:
Version change | Words |
---|---|
Patch | fix, bugfix, [Patch] |
Major | breaking, [Major] |
Minor | Default case if none of the above matches |
Those words are detected in the commit subject only (not in the fully message).
Examples of messages:
- [Breaking] Remove all migration code
- Fix migration code for old centos versions
Include cookbook-release into your Gemfile
.
Require cookbook-release into the metadata.rb
file and replace the version by the helper:
require 'cookbook-release'
version Release.current_version(__FILE__)
Include the rake tasks in your Rakefile:
require 'cookbook-release'
CookbookRelease::Rake::CookbookTask.new
Then you can publish on your supermarket using:
export SUPERMARKET_CLIENTKEYFILE=/tmp/my_key.pem
export SUPERMARKET_USERID=my_username
export SUPERMARKET_URL="http://supermarket.chef.io/api/v1/cookbooks"
export NO_PROMPT=""
export SUPERMARKET_NO_SSL_VERIFY=1
rake release!
Optional environment variables:
export COOKBOOK_CATEGORY="Other" # defaults to Other
Note: this setup is intended to be used in a CI system such as jenkins or travis.
Using:
require 'cookbook-release'
CookbookRelease::Rake::RepoTask.new
will allow to create tasks to generate html changelog between HEAD and master branch. It aims to make some changes more visible such as [Risky] tag (or any tag used for major changes).