Many examples of Capistrano recipes include a role :db. By default, the deployment task exports application code to all hosts in all roles. Thus, this suggests that it is typical for people to keep a copy of their application on the database node. In addition, in a common Capistrano recipe, deploy.rb :deploy:migrateit looks like this:
task :migrate, :roles => :db, :only => { :primary => true } do
end
My question is: why is this done? Wouldn't it be cleaner to keep the application code with the DB host (which Ruby might not have even installed) and run the migrations from the production box?
Ethan source
share