Skip to content

Instantly share code, notes, and snippets.

@r38y
Created January 15, 2009 20:16
Show Gist options
  • Save r38y/47598 to your computer and use it in GitHub Desktop.
Save r38y/47598 to your computer and use it in GitHub Desktop.
require 'capistrano/ext/multistage'
load "config/deploy/#{ARGV.first}"
role :web, domain
role :app, domain
role :db, domain, :primary => true
set :application, "isfeasting"
set :deploy_to, "/home/deploy/public_html/#{application}/#{environment}"
set :user, 'deploy'
set :group, 'users'
set :rails_env, environment
set :repository, "git@github.com:r38y/isfeasting.git"
set :scm, "git"
set :deploy_via, :remote_cache
set :repository_cache, "git_cache"
set :git_enable_submodules, true
ssh_options[:keys] = %w(/Users/randy/.ssh/id_rsa)
ssh_options[:port] = 4392
ssh_options[:forward_agent] = true
task :after_update_code, :roles => :app do
run "ln -s #{shared_path}/database.yml #{release_path}/config/database.yml"
end
task :after_symlink, :roles => :app do
restart_fetcher
restart_delayed_job
end
task :restart_fetcher do
sudo "god restart isfeasting_#{environment}_email_fetcher"
end
task :restart_delayed_job do
sudo "god restart isfeasting-#{environment}-dj"
end
after "deploy", "deploy:cleanup"
after "deploy:migrations", "deploy:cleanup"
namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment