Coder Social home page Coder Social logo

cookbook-release's Introduction

CookbookRelease

Build Status Gem Version

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.

Daily use

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

One-time setup (for cookbooks)

Include cookbook-release into your Gemfile. Put metadata.rb inside the chefignore file (required if berkshelf >= 5.4.0).

Require cookbook-release into the metadata.rb file and replace the version by the helper:

require 'cookbook-release'
version ::CookbookRelease::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
export SKIP_COOKOOK_UPLOAD=true #Just prepare release and push tag to git, but don't upload

Note: this setup is intended to be used in a CI system such as jenkins or travis.

Changelog generation for chef-repositories

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). You may add a sub_dir parameter to restrict the scope of the changes to a sub-directory of the git root.

cookbook-release's People

Contributors

annih avatar antonofthewoods avatar brugidou avatar dlukman avatar guilhem avatar jeremy-clerc avatar jlundqvist-criteo avatar jmauro avatar josqu4red avatar kamaradclimber avatar komuta avatar mat-co avatar pdalpra avatar rveznaver avatar vdemonchy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cookbook-release's Issues

Version computation failing from dependent cookbook

Cookbook A metadata is defined with:

version    ::Release.curent_version

Cookbook B depends on A, and Berksfile is referencing A via path:

source 'https://supermarket.chef.io'
metadata
cookbook 'A', path: '../A'

Version computation does not work.

Error when no git tag

Hey,

When there is no git tag for the cookbook the tool fails (which not bad) but the message is not clear

rake aborted!
NoMethodError: undefined method `to_version' for nil:NilClass
Did you mean?  to_json
/home/jmauro/.gem/ruby/2.3.0/gems/cookbook-release-0.4.2/lib/cookbook-release/git-utilities.rb:45:in `compute_last_release'
/home/jmauro/.gem/ruby/2.3.0/gems/cookbook-release-0.4.2/lib/cookbook-release/release.rb:31:in `last_release'
/home/jmauro/.gem/ruby/2.3.0/gems/cookbook-release-0.4.2/lib/cookbook-release/release.rb:35:in `git_changelog'
/home/jmauro/.gem/ruby/2.3.0/gems/cookbook-release-0.4.2/lib/cookbook-release/release.rb:41:in `block in new_version'
/home/jmauro/.gem/ruby/2.3.0/gems/cookbook-release-0.4.2/lib/cookbook-release/release.rb:40:in `each'
/home/jmauro/.gem/ruby/2.3.0/gems/cookbook-release-0.4.2/lib/cookbook-release/release.rb:40:in `new_version'
/home/jmauro/.gem/ruby/2.3.0/gems/cookbook-release-0.4.2/lib/cookbook-release.rb:33:in `block in define_tasks'
Tasks: TOP => release:suggest_version
(See full trace by running task with --trace)

Support ignoring merge commits

Hi,

First, thank you for that quite handy gem ๐Ÿ‘Œ

Would you accept that cookbook-release supports an option to ignore merge commits during next version computation ?

As unless Github's default merge commit's message is modified before merging or commits are squashed, cookbook-release's current behaviour would always produce at least minor bump version as the merge's commit message doesn't match any of the defined patterns.

I'd be glad to provide a PR if you like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.