Skip to content

Instantly share code, notes, and snippets.

@fayimora
Created February 25, 2012 20:43
Show Gist options
  • Save fayimora/1910525 to your computer and use it in GitHub Desktop.
Save fayimora/1910525 to your computer and use it in GitHub Desktop.
require "bundler/capistrano"
set :application, "myapp"
#github stuff
set :repository, "[email protected]:fayimora/myapp.git"
set :scm, :git
set :scm_username, "xxx"
set :scm_passphrase, "xxx"
set :use_sudo, false
set :deploy_to, "/rails_apps/#{application}"
#server login
set :user, "xxx"
set :password, "xxx"
ssh_options[:forward_agent] = true
set :deploy_via, :remote_cache
# will be different entries for app, web, db if you host them on different servers
server "xxx", :app, :web, :db, :primary => true
namespace :deploy do
task :start, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
task :stop, :roles => :app do
# Do nothing.
end
desc "Restart Application"
task :restart, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
end
before 'deploy:assets:precompile', 'bundle:install'
after "deploy", "deploy:cleanup"
after "deploy:setup", "deploy:setup_shared"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment