I need one task to completely install a new rails app using
mongrel_cluster. This does the trick!
Put this code in some file and require it from your deploy.rb
Capistrano.configuration(:must_exist).load do
desc <<-DESC
You should have created an empty database *before* running this task.
1. Setup initial directory structure
2. Checkout code
3. Install database shema
4. Start mongrel_cluster
DESC
task :install do
setup
update
install_db_schema
cold_deploy
end
desc <<-DESC
Do an initial import of the database
DESC
task :install_db_schema , :roles => :db do
directory = current_path
run "cd #{directory} && " +
"#{rake} RAILS_ENV=#{rails_env} db:schema:load"
end
desc <<-DESC
Used only for deploying when the spinner isn't running. It invokes
deploy,
and when it finishes it then invokes the spinner task (to start the
spinner).
DESC
task :cold_deploy do
update
spinner
end
end
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---