Topic: database passwords, capistrano...

So I've gotten most of a mongrel/mongrel_cluster/capistrano/etc friendly deployment process working.  The one hitch right now is that following the other best practices I've seen I only version control a database.yml-example file, whilethe actual database.yml file isn't versioned controlled to avoid having database connection passwords in SVN....  However this means that the SVN checkout that cap does is missing the database.yml file....

How do people deal with this?

My RoR journey  -- thoughts on learning RoR and lessons learned in applying TDD and agile practices.

Re: database passwords, capistrano...

Capistrano's structure:
site_root/
  releases/
    1/
    2/
  current -> '../releases/2'
  shared/
    system/

What I do is I store my database.yml file (along with any other non-svn'd files) in the shared/system directory.  Then I add the following to my deploy.rb:

desc "link the database.yml file"
task :after_deploy, :roles => :app do
  run "ln -s #{shared_path}/system/database.yml #{current_path}/config/database.yml"
end

Re: database passwords, capistrano...

And cap knows to auto-chain into :after_deploy without having to configure anything else?

My RoR journey  -- thoughts on learning RoR and lessons learned in applying TDD and agile practices.

Re: database passwords, capistrano...

Yep, it should. cap is smart about the before/after wording in the task name and will automatically use it as a callback.

Railscasts - Free Ruby on Rails Screencasts