Skip to content

Commit

Permalink
Merge pull request #6 from igalic/feat/rc
Browse files Browse the repository at this point in the history
feat(release) bump RC version rather than patch
  • Loading branch information
rnelson0 committed Jan 6, 2016
2 parents a6b8dcd + f075559 commit 3a4b9c2
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions lib/voxpupuli-release/rake_tasks.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
require 'puppet_blacksmith/rake_tasks'

Blacksmith::RakeTask.new do |t|
t.build = false # do not build the module nor push it to the Forge
# just do the tagging [:clean, :tag, :bump_commit]
end
desc 'release new version through Travis-ci'
task "travis_release" do

require 'puppet_blacksmith/rake_tasks'
Blacksmith::RakeTask.new do |t|
t.build = false # do not build the module nor push it to the Forge
# just do the tagging [:clean, :tag, :bump_commit]
end

m = Blacksmith::Modulefile.new
v = m.version
raise "Refusing to release an RC or build-release (#{v}).\n" +
"Please set a semver *release* version." unless v =~ /^\d+\.\d+.\d+$/

desc 'Offload release process to Travis.'
task travis_release: [
:check_changelog, # check that the changelog contains an entry for the current release
:"module:release", # do everything except build / push to forge, travis will do that for us
]
Rake::Task[:check_changelog].invoke
# do a "manual" module:release (clean, tag, bump, commit, push tags)
Rake::Task["module:clean"].invoke

# idempotently create tags
g = Blacksmith::Git.new
Rake::Task["module:tag"].invoke unless g.exec_git("tag -l v#{v}").strip == "v#{v}"

v_inc = m.increase_version(v)
v_new = "#{v_inc}-rc0"
ENV['BLACKSMITH_FULL_VERSION'] = v_new
Rake::Task["module:bump:full"].invoke

# push it out, and let travis do the release:
g.commit_modulefile!(v_new)
g.push!
end

desc 'Check Changelog.'
task :check_changelog do
Expand Down

0 comments on commit 3a4b9c2

Please sign in to comment.