Skip to content

Instantly share code, notes, and snippets.

@whistler
Forked from skojin/deploy.rb
Created August 13, 2011 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whistler/1143652 to your computer and use it in GitHub Desktop.
Save whistler/1143652 to your computer and use it in GitHub Desktop.
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"
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