Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
Created September 24, 2012 15:49
Show Gist options
  • Save mlafeldt/3776641 to your computer and use it in GitHub Desktop.
Save mlafeldt/3776641 to your computer and use it in GitHub Desktop.
Ruby one-liner to increment the (patch) version of a Chef cookbook
ruby -pe '$_.to_s.sub!(/^(version.+)(\d+)/) { "#{$1}#{$2.to_i + 1}" }' -i metadata.rb
git commit -m "Version bump by Jenkins" metadata.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment