Skip to content

Instantly share code, notes, and snippets.

@oliyoung
Created July 24, 2008 01:01
Show Gist options
  • Save oliyoung/1977 to your computer and use it in GitHub Desktop.
Save oliyoung/1977 to your computer and use it in GitHub Desktop.
Capistrano deploy script with mongrel specifics
set :application, "application.url.com"
set :repository, "http://svn.#{application}/trunk/"
set :runner, ENV['LOGNAME']
set :deploy_to, "/var/www/#{application}"
role :app, application
role :web, application
role :db, application, :primary => true
task :after_update_code, :roles => :app do
run "ln -s #{deploy_to}/shared/system/mongrel_cluster.yml #{release_path}/config/mongrel_cluster.yml"
run "ln -s #{deploy_to}/shared/system/database.yml #{release_path}/config/database.yml"
end
namespace :deploy do
task :spinner, :roles => :app do
run "/usr/bin/mongrel_rails cluster::restart --clean --config #{release_path}/config/mongrel_cluster.yml"
end
task :start, :roles => :app do
run "/usr/bin/mongrel_rails cluster::start --clean --config #{deploy_to}/current/config/mongrel_cluster.yml"
end
task :restart, :roles => :app do
run "/usr/bin/mongrel_rails cluster::restart --clean --config #{deploy_to}/current/config/mongrel_cluster.yml"
end
task :stop, :roles => :app do
run "/usr/bin/mongrel_rails cluster::stop --clean --config #{deploy_to}/current/config/mongrel_cluster.yml"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment