Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 68c358f9a8b2e877529e61e6648ac254aec90b31 1 parent 4051d08
@tokengeek tokengeek authored
Showing with 30 additions and 15 deletions.
  1. +7 −7 RELEASE.md
  2. +23 −8 Rakefile
View
14 RELEASE.md
@@ -23,13 +23,13 @@ services)
* Update the version number (`lib/fog/version.rb`)
* Run `rake changelog` to update `changelog.txt`
* Run `rake release` to prepare the release which does:
- * Builds the gem (`rake build`)
- * Tags the commit
- * Creates commits for version and pushes to github (Requires
-Credentials)
- * Pushes gem to rubygems (Requires Credentials)
- * Creates site documentation (`rake docs`)
- * Pushes site documentation to S3 (Requires Credentials)
+ * Prepares the release (`rake release:prepare`)
+ * Builds the gem
+ * Tags the commit
+ * Creates commits for version
+ * Publishes the release (`rake release:publish`)
+ * Pushes commit and tag to Github (Requires Credentials)
+ * Pushes gem to Rubygems (Requires Credentials)
## Announce the release
View
31 Rakefile
@@ -95,15 +95,30 @@ end
#
#############################################################################
-task :release => :build do
- unless `git branch` =~ /^\* master$/
- puts "You must be on the master branch to release!"
- exit!
+task :release => ["release:prepare", "release:publish"]
+
+namespace :release do
+ 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
+
+ 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
- sh "gem install pkg/#{name}-#{version}.gem"
- Rake::Task[:git_mark_release].invoke
- Rake::Task[:git_push_release].invoke
- Rake::Task[:gem_push].invoke
end
task :git_mark_release do
Please sign in to comment.
Something went wrong with that request. Please try again.