Capistrano::Configuration.instance(:must_exist).load do

  # source: http://tomcopeland.blogs.com/juniordeveloper/2008/05/mod_rails-and-c.html
  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

    [:start, :stop].each do |t|
      desc "#{t} task is a no-op with mod_rails"
      task t, :roles => :app do ; end
    end

    desc "invoke the db migration"
    task:migrate, :roles => :app do
      send(run_method, "cd #{current_path} && rake db:migrate RAILS_ENV=#{stage} ")
    end
  end

end
