cht-conf
cht-conf copied to clipboard
Add flags to medic-conf to uppload different app_settings depending on target environment
As an extension to #214,
It would be great to extend this modularity to account for situations where we need to maintain different settings per environment. Typical settings that are different based on target environment are gateway settings and outbound as examples.
My proposal would be to have environment switches (as flags) but happy to explore other implementations
related: https://github.com/medic/cht-docs/issues/86 Also worth checking out: https://docs.gitlab.com/ee/user/project/operations/feature_flags.html
@MaxDiz It's not really about feature flags. It's more about changing the gateway phone number from the testing phone to the production phone. This would be particularly helpful for all our integrations so we can keep testing data separate from production data.
My main concern with flags is if a user forgets to include the right flag they'll end up pushing testing config to prod or vice versa.
What may be safer would be if the URL was configured somewhere as well so that didn't have to be provided every time. For example you have the base config as it is now, then you have an environments
folder which has beta
, prod
, and local
(or whatever you like) folders. These folders provide the server URL as well as any configuration overrides. Then if you run medic-conf --env=beta
it just works. That way prod only ever gets prod config.
NB: Credentials will still have to be passed in as params or typed in to a prompt so they don't get committed to the repo.
@garethbowen bummer, it would be a lot cooler if it was :)