require 'bundler/capistrano'
set :application, "app"
set :repository, "/var/www/sites/app/"
set :branch, "master"
set :deploy_to, "/var/www/live/app"
set :user, "user"
default_run_options[:pty] = true
set :copy_exclude, [".git", "spec"]
set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :stages, ["production"]
set :default_stage, "production"
role :web, "web" # Your HTTP server, Apache/etc
role :app, "web" # This may be the same as your `Web` server
role :db, "web", :primary => true # This is where Rails migrations will run
# if you want to clean up old releases on each deploy uncomment this:
set :keep_releases, 5
after "deploy:update_code", "deploy:migrate", "deploy:restart", "deploy:cleanup"
# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end