Skip to content

Instantly share code, notes, and snippets.

@khash
Created October 13, 2011 10:52
Show Gist options
  • Save khash/1283955 to your computer and use it in GitHub Desktop.
Save khash/1283955 to your computer and use it in GitHub Desktop.
require "bundler/capistrano"
require 'san_juan'
set :application, "myapp"
set :repository, "git@git.assembla.com: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