Skip to content

Instantly share code, notes, and snippets.

@skojin
Created January 21, 2011 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save skojin/789624 to your computer and use it in GitHub Desktop.
Save skojin/789624 to your computer and use it in GitHub Desktop.
base capistrano configuration with bunlder and passenger
require 'bundler/capistrano'
set :application, "APPNAME"
set :domain, "mydomain.com"
set :user, "deployer"
set :password, ""
set :runner, user
default_run_options[:pty] = true # Must be set for the password prompt from git to work
set :repository, "git@g....git"
set :scm, "git"
set :scm_passphrase, ""
set :branch, "master"
set :deploy_via, :remote_cache
set :use_sudo, false
set :deploy_to, "/home/#{user}/sites/#{application}"
set :chmod755, "app config db lib public vendor script script/*"
set :normalize_asset_timestamps, false
role :app, domain
role :web, domain
role :db, domain, :primary => true
namespace :deploy do
task :setup_configs, :roles => :app do
run "ln -s #{shared_path}/database.yml #{release_path}/config/database.yml"
end
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