Repository is archived
No commit activity in last 3 years
No release in over 3 years
Use credentials set in ENV vars if database.yml credentials are empty. Supports MySQL and ElephantSQL (Postgres) on the cloudControl platform.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

#cctrl_database_configuration

Override empty database.yml settings with the ENV vars on the cloudControl plattform. Supports MySQLs, MySQLd and ElephantSQL (Postgres)

##Installation

Add the following to your gemfile

gem "cloudcontrol-rails"

And run bundle install

Now modify or create your database.yml and leave the credentials empty. You can override everything anytime by just adding them again.

To share a database over two deployments without hardcoding the credentials you need to add them with the Custom Config Addon

##Example database.yml

Credentials will be served through the gem:

production:
  host:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database:
  pool: 5
  username:
  password:

Credentials will not be touched because they are not empty:

production:
  host: localhost
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: db_name
  pool: 5
  username: username
  password: password

You can also serve specific values only through the gem:

production:
  host: localhost
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: db_name
  pool: 5
  username:
  password: