summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-07-26 09:25:54 -0700
committermo khan <mo@mokhan.ca>2013-07-26 09:25:54 -0700
commit6dead347a06849a67e87dfdb36ca63efc05e7024 (patch)
tree1831f47cccdc06efc59b6765e901846f7ffde3d4
parent180f5486575b535de3f56d0a124c95b2f2f4a621 (diff)
parentf6f238c88a0324a3ee60783479e35671b50bdf32 (diff)
Merge pull request #13 from madebyuppercut/ty
run db migrations by default
-rw-r--r--config/deploy.rb19
-rw-r--r--config/deploy/mo.rb9
-rw-r--r--config/deploy/prod.rb (renamed from config/deploy/production.rb)6
-rw-r--r--config/deploy/qa.rb1
-rw-r--r--config/recipes/check.rb13
-rw-r--r--config/recipes/environments.rb5
-rw-r--r--config/recipes/rbenv.rb9
7 files changed, 24 insertions, 38 deletions
diff --git a/config/deploy.rb b/config/deploy.rb
index 33876a1..d366501 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -1,30 +1,25 @@
require "bundler/capistrano"
-set :stages, %w(production mo) # this needs to be set before 'capistrano/ext/multistage' is required in
-set :default_stage, "production" # this needs to be set before 'capistrano/ext/multistage' is required in
-require 'capistrano/ext/multistage'
+load "config/recipes/environments"
load "config/recipes/base"
load "config/recipes/nginx"
load "config/recipes/unicorn"
load "config/recipes/postgresql"
load "config/recipes/nodejs"
load "config/recipes/rbenv"
-load "config/recipes/check"
load "config/recipes/newrelic"
set :application, "parley"
set :user, "deployer"
-set :deploy_to, "/home/#{user}/apps/#{application}"
-set :deploy_via, :remote_cache # keeps git repo on server cache
set :use_sudo, false
-
-set :scm, "git"
-set :branch, "master"
-set :repository, "git@github.com:madebyuppercut/parley.git"
-
default_run_options[:pty] = true # password prompt
-ssh_options[:forward_agent] = true # no deploy key for github
+set :scm, :none
+set :repository, "."
+set :deploy_via, :copy
+set :deploy_to, "/home/#{user}/apps/#{application}"
+
+after "deploy:update_code", "deploy:migrate"
after "deploy", "deploy:cleanup" # keep only the last 5 releases
# Instructions
diff --git a/config/deploy/mo.rb b/config/deploy/mo.rb
index 7a4aa1a..8303ec5 100644
--- a/config/deploy/mo.rb
+++ b/config/deploy/mo.rb
@@ -1,8 +1 @@
-# Your HTTP server, Apache/etc
-role :web, "192.241.151.56"
-# This may be the same as your `Web` server
-role :app, "192.241.151.56"
-# This is where Rails migrations will run
-role :db, "192.241.151.56", primary: true
-
-set :branch, "mo"
+server "192.241.151.56", :web, :app, :db, primary: true
diff --git a/config/deploy/production.rb b/config/deploy/prod.rb
index b4224ee..dbf27dd 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/prod.rb
@@ -1,8 +1,8 @@
# Your HTTP server, Apache/etc
-role :web, "www.parleytool.com"
+role :web, "198.199.118.206"
# This may be the same as your `Web` server
-role :app, "www.parleytool.com"
+role :app, "198.199.118.206"
# This is where Rails migrations will run
-role :db, "www.parleytool.com", primary: true
+role :db, "198.199.118.206", primary: true
#role :db, "your slave db-server here"
diff --git a/config/deploy/qa.rb b/config/deploy/qa.rb
new file mode 100644
index 0000000..1d031f0
--- /dev/null
+++ b/config/deploy/qa.rb
@@ -0,0 +1 @@
+server "192.241.204.27", :web, :app, :db, primary: true
diff --git a/config/recipes/check.rb b/config/recipes/check.rb
deleted file mode 100644
index 45a6e1f..0000000
--- a/config/recipes/check.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace :check do
- desc "Make sure local git is in sync with remote."
- task :revision, roles: :web do
- unless `git rev-parse HEAD` == `git rev-parse origin/#{branch}`
- puts "WARNING: HEAD is not the same as origin/#{branch}"
- puts "Run `git push` to sync changes."
- exit
- end
- end
- before "deploy", "check:revision"
- before "deploy:migrations", "check:revision"
- before "deploy:cold", "check:revision"
-end
diff --git a/config/recipes/environments.rb b/config/recipes/environments.rb
new file mode 100644
index 0000000..cee0993
--- /dev/null
+++ b/config/recipes/environments.rb
@@ -0,0 +1,5 @@
+set :stages, %w(prod qa mo)
+set :default_stage, "qa"
+
+# this needs to be set last
+require 'capistrano/ext/multistage'
diff --git a/config/recipes/rbenv.rb b/config/recipes/rbenv.rb
index b84adc8..0c4d905 100644
--- a/config/recipes/rbenv.rb
+++ b/config/recipes/rbenv.rb
@@ -1,7 +1,7 @@
set_default :ruby_version, "2.0.0-p247"
namespace :rbenv do
- desc "Install rbenv, Ruby, and the Bundler gem"
+ desc "Install rbenv"
task :install, roles: :app do
# Install development tools:
run "#{sudo} apt-get -y install build-essential"
@@ -26,10 +26,15 @@ BASHRC
run "mv ~/.bashrc.tmp ~/.bashrc"
run %q{export PATH="$HOME/.rbenv/bin:$PATH"}
run %q{eval "$(rbenv init -)"}
+ end
+ after "deploy:install", "rbenv:install"
+
+ desc "Setup rbenv with ruby and bundler"
+ task :setup, roles: :web do
run "rbenv install #{ruby_version}"
run "rbenv global #{ruby_version}"
run "gem install bundler --no-ri --no-rdoc"
run "rbenv rehash"
end
- after "deploy:install", "rbenv:install"
+ after "deploy:setup", "rbenv:setup"
end