mdsol / dice_bag

DiceBag is a library of rake tasks for configuring web apps in the style of The Twelve-Factor App.
MIT License
19 stars 4 forks source link

Feature/update database yml template #78

Closed rbuenviaje closed 8 years ago

rbuenviaje commented 8 years ago

Puts in bangs to require that the database_name, password, host, and username are provided when building in production. Also does not build the test/development settings out when running rake config in the production environment. This prevents db:test:prepare or any other default take task that runs on test or development environment to perform actions on the production database.

jcarres-mdsol commented 8 years ago

@jfeltesse-mdsol @ykitamura-mdsol @ssteeg-mdsol

pmavinkurve-mdsol commented 8 years ago

@rbuenviaje-mdsol thanks for this PR. Does that mean that the bundle exec rake would simply fail for production environment? If we used this template.

Adding: And not do any harm?

rbuenviaje commented 8 years ago

@pmavinkurve-mdsol yep! What we normally have as the default is to run tests, so that wouldn't be possible. Removing test completely from local dev and running rake causes this error to appear.

/Users/rbuenviaje/.rvm/gems/ruby-2.2.3@mccadmin/gems/activerecord-4.2.6/lib/active_record/connection_adapters/connection_specification.rb:248:in resolve_symbol_connection': 'test' database is not configured. Available: ["development"] (ActiveRecord::AdapterNotSpecified)

I'll be testing this on the cloud in a bit to verify completely, but right now it looks good.

rbuenviaje commented 8 years ago

Yep. Tested on Checkmate testing cloud with only production defined.

checkmate@ip-10-224-244-228:~/current$ bundle exec rake
checkmate@ip-10-224-244-228:~/current$

And the database is still fine. :)

pmavinkurve-mdsol commented 8 years ago

@rbuenviaje-mdsol i didn't know checkmate had a database. but thanks for the verification!

jfeltesse-mdsol commented 8 years ago

LGTM, letting @jcarres-mdsol merge if he's 🆒 with the changes.

jcarres-mdsol commented 8 years ago

It's out! https://rubygems.org/gems/dice_bag/versions/1.1.1

jfeltesse-mdsol commented 8 years ago