Skip to content

Instantly share code, notes, and snippets.

@rumblex
Created October 19, 2008 13:52
Show Gist options
  • Select an option

  • Save rumblex/17831 to your computer and use it in GitHub Desktop.

Select an option

Save rumblex/17831 to your computer and use it in GitHub Desktop.
# Note: under the shared directory, have a config subdir with the database.yml file in it.
default_run_options[:pty] = true
set :application, ""
set :deploy_to, "/var/www/apps/#{application}"
set :scm, :git
set :repository, "git@github.com:railsrumble/#{application}.git"
set :branch, "master"
set :deploy_via, :remote_cache
set :user, 'deploy' # Or whatever you're using
set :domain, "something"
role :app, domain
role :web, domain
role :db, domain, :primary => true
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
task :after_update_code, :roles => :app do
run "cp #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end
end
desc "Monitor the production log"
task :production_log, :roles => :app do
run "tail -n 150 -f #{shared_path}/log/production.log" do |channel, stream, data|
puts # for an extra line break before the host name
puts "#{channel[:host]}: #{data}"
break if stream == :err
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment