summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-06-16 08:21:36 -0600
committermo khan <mo@mokhan.ca>2013-06-16 08:21:36 -0600
commitd5093dd739db07afdfe4e19d58e0033d6226dd8d (patch)
tree867ec69b30ebb79ec922a1d5073f6633e6ffbd47
parent19c63a16bed07fc0af60078d2acf0f4cd8332f3b (diff)
parent430119a0fead66655f94d1c7e2c82e0055a3f82b (diff)
Merge branch 'master' of bitbucket.org:mocheen/cakeside
-rw-r--r--capfile4
-rw-r--r--config/deploy.rb1
-rw-r--r--lib/tasks/ci.rake15
-rw-r--r--lib/tasks/deployment.rake5
-rw-r--r--lib/tasks/ssh.rake11
-rw-r--r--public/assets/default.pngbin0 -> 11252 bytes
-rw-r--r--public/assets/large_default.pngbin0 -> 11252 bytes
-rw-r--r--public/assets/thumb_default.pngbin0 -> 11252 bytes
-rw-r--r--script/deploy-production.sh10
-rw-r--r--script/deploy-staging.sh9
10 files changed, 39 insertions, 16 deletions
diff --git a/capfile b/capfile
index ae22d8c5..a6ec7698 100644
--- a/capfile
+++ b/capfile
@@ -1,5 +1,5 @@
-load 'deploy' if respond_to?(:namespace) # cap2 differentiator
-Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'deploy'
+#load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks
task :search_libs, :roles => :web do
diff --git a/config/deploy.rb b/config/deploy.rb
index ab2a2f41..b93ecc32 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -1,4 +1,3 @@
-#$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, 'ruby-2.0.0-p195@cakeside'
set :rvm_type, :system
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake
index 52f562c0..78bae684 100644
--- a/lib/tasks/ci.rake
+++ b/lib/tasks/ci.rake
@@ -1 +1,14 @@
-task :ci => ['db:test:prepare', 'spec', 'jasmine:ci']
+task :ci => ['db:migrate', 'db:test:prepare', 'spec', 'jasmine:ci']
+
+namespace :ci do
+ 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'"
+ sh "git push --tags"
+ Rake::Task['deploy:staging'].invoke
+ end
+ task :production => ['deploy:production']
+ end
+end
+
diff --git a/lib/tasks/deployment.rake b/lib/tasks/deployment.rake
index ce7cb773..0e1aef98 100644
--- a/lib/tasks/deployment.rake
+++ b/lib/tasks/deployment.rake
@@ -1,9 +1,11 @@
namespace :deploy do
desc "deploy to staging server"
- task :staging => :spec do
+ task :staging do
sh "cap staging deploy:migrations"
+ sh "cap staging deploy:cleanup"
sh "curl http://staging.cakeside.com/ > /dev/null"
end
+
desc "deploy to production server"
task :production, :tag do |t, args|
tag_to_deploy = args.tag
@@ -15,3 +17,4 @@ namespace :deploy do
sh "curl http://cakeside.com/ > /dev/null"
end
end
+
diff --git a/lib/tasks/ssh.rake b/lib/tasks/ssh.rake
deleted file mode 100644
index 8ef426dd..00000000
--- a/lib/tasks/ssh.rake
+++ /dev/null
@@ -1,11 +0,0 @@
-desc "install ssh keys"
-task :install_keys do
- sh "cp doc/keys/*.pem ~/.ssh/amazon-cakeside/"
-end
-
-namespace :ssh do
- desc "deploy to staging server"
- task :staging do
- sh "ssh ubuntu@ec2-23-22-119-121.compute-1.amazonaws.com -i ~/.ssh/amazon-cakeside/stagingcakesidecom.pem"
- end
-end
diff --git a/public/assets/default.png b/public/assets/default.png
new file mode 100644
index 00000000..e4c605f3
--- /dev/null
+++ b/public/assets/default.png
Binary files differ
diff --git a/public/assets/large_default.png b/public/assets/large_default.png
new file mode 100644
index 00000000..e4c605f3
--- /dev/null
+++ b/public/assets/large_default.png
Binary files differ
diff --git a/public/assets/thumb_default.png b/public/assets/thumb_default.png
new file mode 100644
index 00000000..e4c605f3
--- /dev/null
+++ b/public/assets/thumb_default.png
Binary files differ
diff --git a/script/deploy-production.sh b/script/deploy-production.sh
new file mode 100644
index 00000000..26a401cb
--- /dev/null
+++ b/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
diff --git a/script/deploy-staging.sh b/script/deploy-staging.sh
new file mode 100644
index 00000000..d4ed15e1
--- /dev/null
+++ b/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