Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update the release procedure #19

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lib/voxpupuli/release/rake_tasks.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
desc 'Prepare a new release'
task :prepare_release, [:version] do |t, args|
unless args[:version]
puts 'you need to provide a version like: rake prepare_release[1.0.0]'
exit
end

version = args[:version]
if ['major', 'minor', 'patch'].include?(version)
bump_task = "module:bump:#{version}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch will need special treatment: Bumping version from 2.0.1-rc0 to 2.0.2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about allowing users to specify a specific version as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be supported in the elsif clause

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

voxpupuli/puppet-blacksmith#62 should handle the bumping issue.

elsif /^\d+\.\d+\.\d+$/.match(version)
bump_task = 'module:bump:full'
ENV['BLACKSMITH_FULL_VERSION'] = version
else
puts 'Version needs to be major, minor, patch or in the X.X.X format'
exit
end

Rake::Task[bump_task].invoke
Rake::Task['changelog'].invoke
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work. The future version is read when the Rakefile is loaded, then bumped at runtime but not re-read.

end

desc 'release new version through Travis-ci'
task "travis_release" do
Expand Down