Commit 6d674881
Changed files (3)
lib
tasks
script
lib/tasks/ci.rake
@@ -1,1 +1,10 @@
task :ci => ['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
+ end
+end
+
lib/tasks/deployment.rake
@@ -1,7 +1,8 @@
namespace :deploy do
desc "deploy to staging server"
- task :staging => :spec do
+ task :staging do
sh "cap staging deploy:migrations"
+ sh "cap staging deploy:clean"
sh "curl http://staging.cakeside.com/ > /dev/null"
end
@@ -16,3 +17,4 @@ namespace :deploy do
sh "curl http://cakeside.com/ > /dev/null"
end
end
+
script/deploy-staging.sh
@@ -0,0 +1,9 @@
+#!/bin/bash -x
+echo "load bashrc"
+source ~/.bashrc
+
+echo 'switch gemset'
+rvm use ruby-2.0.0-p195@cakeside --create
+
+echo 'bundle install'
+bundle exec rake ci:deploy_staging --trace