Skip to content

Instantly share code, notes, and snippets.

@cearls
Created June 19, 2012 20:56
Show Gist options
  • Save cearls/2956505 to your computer and use it in GitHub Desktop.
Save cearls/2956505 to your computer and use it in GitHub Desktop.
Capistrano recipe: WebFaction, Padrino, Bundler, DataMapper
set :application, "multio"
set :scm, :git
set :repository, "git@bitbucket.org:cearls/multio.git"
set :domain, "web310.webfaction.com"
set :user, "cearls"
set :scm_username, "cearls"
set :use_sudo, false
default_run_options[:pty] = true
set :ssh_options, {:forward_agent => true}
role :web, domain
role :app, domain
role :db, domain, :primary => true
set :deploy_to, "/home/#{user}/webapps/#{application}"
set :default_environment, {
'PATH' => "#{deploy_to}/bin:$PATH",
'GEM_HOME' => "#{deploy_to}/gems"
}
set :rake, 'bundle exec padrino rake'
namespace :deploy do
desc "Restart nginx"
task :restart do
run "#{deploy_to}/bin/restart"
end
task :migrate do
run "cd #{current_path}; RACK_ENV=production bundle exec padrino rake dm:auto:upgrade"
end
task :bundle, :roles => :app do
run "cd #{release_path} && bundle install --deployment --without development test"
end
end
after "deploy:update_code", "deploy:bundle"
after "deploy", "deploy:migrate"
after "deploy", "deploy:cleanup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment