Skip to content

Instantly share code, notes, and snippets.

@qrush
Created August 14, 2008 13:16
Show Gist options
  • Save qrush/5425 to your computer and use it in GitHub Desktop.
Save qrush/5425 to your computer and use it in GitHub Desktop.
#############################################################
# Application
#############################################################
set :application, "" #your app's name here
set :server_ip, "" #your server's ip here
set :deploy_to, "/home/rails/#{application}" #the path to your rails app here
#############################################################
# Servers
#############################################################
set :user, "rails" # whatever user you're logging in as. Don't use root.
ssh_options[:port] = 22 # fill in the port here
role :app, server_ip
role :web, server_ip
role :db, server_ip, :primary=>true
#############################################################
# Subversion
#############################################################
set :repository, "" #set your repo here
set :svn_username, "rails"
set :svn_password, Proc.new { Capistrano::CLI.password_prompt("SVN Password for #{svn_username}: ") }
set :checkout, "export"
#############################################################
# Passenger
#############################################################
namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
desc "Perform final actions to get the server ready"
task :setup do
run "mv #{current_path}/config/database.yml.tmp #{current_path}/config/database.yml"
run "touch #{current_path}/log/production.log"
end
[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end
end
after "deploy:symlink", "deploy:setup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment