Skip to content

Instantly share code, notes, and snippets.

@whistler whistler/deploy.rb forked from skojin/deploy.rb
Created Aug 13, 2011

What would you like to do?
base capistrano configuration for passenger
set :application, "appname"
set :domain, "domain.tld"
role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Rails migrations will run
set :repository, "." # Deploy from the local repository
set :scm, "git"
set :branch, "master"
set :user, "root"
set :deploy_to, "/var/www/#{application}"
set :deploy_via, :copy # Deploy using copy
set :chmod755, "app config db lib public vendor script script/*"
default_run_options[:pty] = true # Must be set for the password prompt from git to work
namespace :deploy do
task :setup_configs, :roles => :app do
run "ln -s #{shared_path}/database.yml #{release_path}/config/database.yml"
# For passenger, start & stop do nothing and for restart touch restart.txt file
task :start do ; restart end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path,'tmp','restart.txt')}"
after 'deploy:update_code', 'deploy:setup_configs', 'deploy:migrate'
after 'deploy', 'deploy:cleanup'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.