[core] Breaks down rake tasks
While documenting our release process, we can see some things that don't need to be locked together are. This splits release into prepare/publish parts Now anyone can prepare a release but will not be able to publish that release without the correct access to Github and Rubygems. Adds a preflight task and adds a check for existing tags to that.
This commit is contained in:
parent
99756dd679
commit
28d6e219f3
14
RELEASE.md
14
RELEASE.md
|
@ -23,13 +23,13 @@ services)
|
||||||
* Update the version number (`lib/fog/version.rb`)
|
* Update the version number (`lib/fog/version.rb`)
|
||||||
* Run `rake changelog` to update `changelog.txt`
|
* Run `rake changelog` to update `changelog.txt`
|
||||||
* Run `rake release` to prepare the release which does:
|
* Run `rake release` to prepare the release which does:
|
||||||
* Builds the gem (`rake build`)
|
* Prepares the release (`rake release:prepare`)
|
||||||
* Tags the commit
|
* Builds the gem
|
||||||
* Creates commits for version and pushes to github (Requires
|
* Tags the commit
|
||||||
Credentials)
|
* Creates commits for version
|
||||||
* Pushes gem to rubygems (Requires Credentials)
|
* Publishes the release (`rake release:publish`)
|
||||||
* Creates site documentation (`rake docs`)
|
* Pushes commit and tag to Github (Requires Credentials)
|
||||||
* Pushes site documentation to S3 (Requires Credentials)
|
* Pushes gem to Rubygems (Requires Credentials)
|
||||||
|
|
||||||
## Announce the release
|
## Announce the release
|
||||||
|
|
||||||
|
|
37
Rakefile
37
Rakefile
|
@ -95,16 +95,43 @@ end
|
||||||
#
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
task :release => :build do
|
task :release => ["release:prepare", "release:publish"]
|
||||||
unless `git branch` =~ /^\* master$/
|
|
||||||
puts "You must be on the master branch to release!"
|
namespace :release do
|
||||||
exit!
|
task :preflight do
|
||||||
|
unless `git branch` =~ /^\* master$/
|
||||||
|
puts "You must be on the master branch to release!"
|
||||||
|
exit!
|
||||||
|
end
|
||||||
|
if `git tag` =~ /^\* v#{version}$/
|
||||||
|
puts "Tag v#{version} already exists!"
|
||||||
|
exit!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
sh "gem install pkg/#{name}-#{version}.gem"
|
|
||||||
|
task :prepare => :preflight do
|
||||||
|
Rake::Task[:build].invoke
|
||||||
|
sh "gem install pkg/#{name}-#{version}.gem"
|
||||||
|
Rake::Task[:git_mark_release].invoke
|
||||||
|
end
|
||||||
|
|
||||||
|
task :publish do
|
||||||
|
Rake::Task[:git_push_release].invoke
|
||||||
|
Rake::Task[:gem_push].invoke
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
task :git_mark_release do
|
||||||
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
||||||
sh "git tag v#{version}"
|
sh "git tag v#{version}"
|
||||||
|
end
|
||||||
|
|
||||||
|
task :git_push_release do
|
||||||
sh "git push origin master"
|
sh "git push origin master"
|
||||||
sh "git push origin v#{version}"
|
sh "git push origin v#{version}"
|
||||||
|
end
|
||||||
|
|
||||||
|
task :gem_push do
|
||||||
sh "gem push pkg/#{name}-#{version}.gem"
|
sh "gem push pkg/#{name}-#{version}.gem"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue