set :application, "your_application_name"
set :deploy_to, "/home/a_user_on_your_server/apps/#{application}"
#############################################################
# Settings
#############################################################
default_run_options[:pty] = true
set :use_sudo, true
set :port, 22
#############################################################
# Servers
#############################################################
set :user, "your_remote_server_username"
set :domain, "your_remote_server_ip"
set :runner, "your_remote_server_username"
server domain, :app, :web
role :db, domain, :primary => true
#############################################################
# GIT
#############################################################
set :repository, "the_address_for_your_git_repository_with_your_project_source_code"
set :scm, "git"
ssh_options[:forward_agent] = true
set :branch, "master"
#############################################################
# Passenger
#############################################################
namespace :deploy do
# Restart passenger on deploy
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end
end
#optional task so that you can manually restart whenever you want
namespace :passenger do
desc "Restart Passenger Application"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
# task example to run after a successful deploy, use it to copy files, create symlinks and much more
#desc "after updating code, it copies production database yml"
#task :after_update_code, :roles=> :app do
# run "cp #{release_path}/config/production.database.yml #{release_path}/config/database.yml"
#end