Skip to content

Instantly share code, notes, and snippets.

@dillonhafer
Last active May 31, 2017 17:15
Show Gist options
  • Save dillonhafer/dc42dc9b158252de940432d2079a46b2 to your computer and use it in GitHub Desktop.
Save dillonhafer/dc42dc9b158252de940432d2079a46b2 to your computer and use it in GitHub Desktop.
Dynamic Database YAML
<% branch = `git rev-parse --abbrev-ref HEAD`.match(/(PHI-\d+)/).try(:captures).try(:first) || "development" %>
default: &default
adapter: postgresql
encoding: unicode
pool: 5
timeout: 5000
variables:
statement_timeout: 15000
development:
<<: *default
database: <%= "phishing_#{branch}" %>
test: &test
<<: *default
database: phishing_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment