In my company, we actually have both.
We have a Rails application that can point to one of many different installations of other software and use the APIs from that installation. To indicate the installation, you need to set about 5 variables.
We used each of these variables as separate environment variables, but having established that they all became old very quickly, we inevitably forgot it.
So now we have one environment variable that we call ENV_TOKEN, and we have yaml files containing entries that match the actual ENV_TOKEN variables, and the code in config / initializers, which sets the value to ENV [key] =.
So, let's say I have the βFOOβ and βBARβ variables, which I want to set to βoneβ and βtwoβ, respectively. I can create a yaml file that contains:
carolclarinet: FOO: one BAR: two
and then I would set my ENV_TOKEN environment variable to carolclarinet, and FOO and BAR to one and two.
I have no idea how this is the best way to do this, but it works for us.
ETA: Please note that this is only for development and testing, the installer of our software takes care of installing all this so that our clients never change any environment variables.
carols10cents
source share