Alex Rivera | Logout

database.yml deployment best practice

Asked 2011-04-26T01:53:37.260
21

I don't check my database.yml file into source control and I was wondering what others do/best practice for copying this file over to the server when deploying.

I use Capistrano for deployment.

Edit
Report

1 Answer

9

My deployment script was breaking using the after "deploy:update_code" hook because that step seemed to be trying to access the DB already. So I do:

before "deploy:assets:precompile", 'deploy:symlink_shared'

namespace :deploy do

  task :symlink_shared do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  end
end
answered 2013-03-28T18:02:56.680

Your Answer