mbucc / shmig

Database migration tool written in BASH.
BSD 3-Clause "New" or "Revised" License
461 stars 50 forks source link

Implemented local override config file #39

Closed kael-shipman closed 6 years ago

kael-shipman commented 6 years ago

This PR allows users to specify a local configuration file shmig.local.conf that they can ignore from version control, such that they may specify instance-specific configs that override the default configs in shmig.conf.

This is a scheme I much prefer to environment variables, as there is virtually no devops overhead -- you just add the configs in the local file and any user that runs the program will have access to them.

This can be used to easily implement multiple environments, as you've demonstrated with prod vs test, among other things.

Also, if you haven't seen bash_unit, I've found it to be pretty cool. I didn't use it here because I didn't want to disrupt your test flow, but thought you might like to know :).

mbucc commented 6 years ago

What a great PR, thanks for you efforts! I suggested one small tweak to drop a bashism; see the comment I made in the PR diff.

kael-shipman commented 6 years ago

Haha, that's funny, I actually only used source because it was used in the original config function on line 649. I've changed both instances to '.'.