Commit 04ead628

mo khan <mo@mokhan.ca>
2013-06-06 03:32:06
create script to deploy to production
1 parent bfd6576
lib/tasks/ci.rake
@@ -1,10 +1,13 @@
 task :ci => ['db:migrate', 'db:test:prepare', 'spec', 'jasmine:ci']
 
 namespace :ci do
-  task :deploy_staging do
-    now = Time.now
-    sh "git tag -a 'staging-#{now.strftime('%Y-%m-%d')}-#{now.to_i}-jenkins-continuous-deployment' -m 'just push it'"
-    Rake::Task['deploy:staging'].invoke
+  namespace :deploy do
+    task :staging do
+      now = Time.now
+      sh "git tag -a 'staging-#{now.strftime('%Y-%m-%d')}-#{now.to_i}-jenkins-continuous-deployment' -m 'just push it'"
+      Rake::Task['deploy:staging'].invoke
+    end
+    task :production => ['deploy:production']
   end
 end
 
script/deploy-production.sh
@@ -0,0 +1,10 @@
+#!/bin/bash -x
+echo "load bashrc"
+source ~/.bashrc
+
+echo 'switch gemset'
+rvm use ruby-2.0.0-p195@cakeside --create
+
+echo 'bundle install'
+git checkout master
+bundle exec rake ci:deploy:production --trace
script/deploy-staging.sh
@@ -7,4 +7,4 @@ rvm use ruby-2.0.0-p195@cakeside --create
 
 echo 'bundle install'
 git checkout master
-bundle exec rake ci:deploy_staging --trace
+bundle exec rake ci:deploy:staging --trace