-
-
Save whistler/1143652 to your computer and use it in GitHub Desktop.
base capistrano configuration for passenger
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
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" | |
end | |
# 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')}" | |
end | |
end | |
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