Permalink
Browse files

[core] Breaks down rake tasks

While documenting our release process, we can see some things that don't
need to be locked together are. Mostly generating files and uploading
them or packaging the release and immediately pushing.

Breaking these down will allow refactoring the steps or regrouping them
so preparing a release is not coupled with pushing the new release and
requiring lots of credentials (rubygems, github etc.).
  • Loading branch information...
tokengeek committed Dec 27, 2012
1 parent cb4a1cc commit 99cb063ceea20ce5550db26b0e647a1294fe9308
Showing with 26 additions and 2 deletions.
  1. +13 −1 Rakefile
  2. +13 −1 lib/tasks/documentation_task.rb
View
@@ -101,12 +101,24 @@ task :release => :build do
exit!
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
+ Rake::Task[:docs].invoke
+end
+
+task :git_mark_release do
sh "git commit --allow-empty -a -m 'Release #{version}'"
sh "git tag v#{version}"
+end
+
+task :git_push_release do
sh "git push origin master"
sh "git push origin v#{version}"
+end
+
+task :gem_push do
sh "gem push pkg/#{name}-#{version}.gem"
- Rake::Task[:docs].invoke
end
task :build => :gemspec do
@@ -5,11 +5,23 @@ module Fog
module Rake
class DocumentationTask < ::Rake::TaskLib
def initialize
- task :docs do
+ task :docs => [:prepare_docs, :upload_docs]
+
+ desc "Generates documentation"
+ task :prepare_docs do
Rake::Task[:supported_services_docs].invoke
+ Rake::Task[:build_fog_io].invoke
+ end
+
+ desc "Uploads documentation to S3"
+ task :upload_docs do
Rake::Task[:upload_fog_io].invoke
Rake::Task[:upload_yardoc].invoke
+ Rake::Task[:upload_redirector_index].invoke
+ end
+
+ task :upload_redirector_index do
# connect to storage provider
Fog.credential = :geemus
storage = Fog::Storage.new(:provider => 'AWS')

0 comments on commit 99cb063

Please sign in to comment.