How to share your database.yml between releases

One of the great benefits of our Shared Area is that you can get the database.yml file out of your version control system but still have everything work as planned.

Adjust the deploy.rb config

Make sure you have adjusted your local area config to include the database.yml file:

set :global_shared_files, %w(config/database.yml)

If you have more than one machine and have a network drive mounted you can alter the global_shared_path so that the database.yml is shared across all your application machines.

set :global_shared_path, '/srv/share/myapp'

Run deploy:setup to create the config directory in the shared area.

Create a database.yml

You can either create the database.yml directly on the server (in the myapp/shared/config directory), or create it locally and upload it to the same place.

Deploy your application

When you deploy the application the gem will create the link to the database.yml in the shared area.

docs/gemv2/share_database_yml.txt · Last modified: 2009/05/08 18:05 (external edit)