Created
October 13, 2011 10:52
-
-
Save khash/1283955 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/capistrano" | |
require 'san_juan' | |
set :application, "myapp" | |
set :repository, "[email protected]:myapp.git" | |
set :scm, :git | |
set :user, 'deploy' | |
set :use_sudo, false | |
set :deploy_to, "/var/www/#{application}" | |
set :deploy_via, :remote_cache | |
ssh_options[:forward_agent] = true | |
default_run_options[:pty] = true | |
role :web, "server1.myapp.com" | |
role :app, "server1.myapp.com" | |
role :db, "server1.myapp.com", :primary => true | |
san_juan.role :app, %w(scheduler workers) | |
namespace :deploy do | |
task :start do | |
god.all.start | |
end | |
task :stop do | |
god.all.terminate | |
end | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
god.all.reload | |
god.app.scheduler.restart | |
god.app.workers.restart | |
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment