Capistrano and database.yml  June 3rd, 2009 at 7:06 am •
permalink10 comments  Capistrano logoLast week, an user asked
the Capistrano mailing list about database password best
practices. This reminded me that I never posted here a
Capistrano recipe I created almost one year ago to solve exactly
this problem.  Which problem?  Imagine you need to deploy a new
Rails application. As you probably know, Rails stores all the
database configurations in a single file called
config/database.yml, including database authentication
credentials.  This file usually lives in your repository along
with all your application code base. However, exposing real
world passwords to all developers with read access to the
repository can lead to major security problems. It’s likely you
don’t want to store sensitive data in your repository, thus you
need to automatically generate the config.yml file somehow on
deploy or on setup.  If you are using Capistrano to deploy your
Rails application, you can ask Capistrano to generate and upload