Commit 8db18c1a

mo k <mo@mokhan.ca>
2012-06-02 12:56:53
add rake task to deploy rake deploy:production and rake deploy:staging. PLEASE USE THESE TASKS not cap staging deploy
1 parent 3ce7caa
Changed files (1)
Rakefile
@@ -6,21 +6,23 @@ require 'rake'
 
 Cake::Application.load_tasks
 
-task :deploy_live do
-  sh "cap production deploy"
-end
-
 task :install_keys do
   sh "cp doc/keys/*.pem ~/.ssh/amazon-cakeside/"
 end
 
 namespace :deploy do
   task :staging do
-    #branch_name = "staging-#{Time.now.strftime('%Y-%m-%d-%T')}"
-    #sh "git branch #{branch_name}"
-    #sh "git push origin #{branch_name}"
-    puts "staging is fun! #{branch_name}"
-    #sh "cap staging deploy branch=#{branch_name}"
+    sh "cap staging deploy"
+  end
+  task :production, :tag do |t, args|
+    tag_to_deploy = args.tag
+    if tag_to_deploy.blank?
+      puts "please specify the name of the tag to deploy"
+      puts "E.g. rake deploy:production['staging-2012-06-02-1-mo-user-settings']"
+    else
+      puts "deploying to production from tag #{tag_to_deploy}"
+      sh "cap production deploy -s tag=#{tag_to_deploy}"
+    end
   end
 end