If you use `foreman` [2] to manage application process formations, it will source a '.env' file before running.
You could call either pattern a "config file" but the important part is that its actual Unix environment variables, and there is a safe and secure place to store the variables outside of the code repository.
Then... you can take a huge leap forward when running on Heroku. Heroku has an API to set environment variables:
$ heroku config:add API_PASSWORD=abc123
That value will be present in the runtime environment for the life of your application. So you do enter them manually -- but only one time when setting up an app.The really clever part is that 3rd party add-on providers can also set environment variables on your app with a similar API. So if your database is an add-on:
$ heroku addons:add redistogo
$ heroku config
REDISTOGO_URL => redis://user:pass@host-1:9492/
$ heroku addons:upgrade redistogo:medium
$ heroku config
REDISTOGO_URL => redis://user:pass@host-2:9133/
If settings are in config files, you would have to deploy new code to change settings, and you wouldn't have a way for your hosting platform to help manage settings.I'd prefer that a project can be set up for development as quickly as possible, so my current approach is to check in default configurations for the development environment that are overridden with environment variables in production.
2) there are several options, a developer (gold CD) virtual is one, where a virtual is set up and configured based on updated configuration and an automated script, or having a environmental script that sets up the development variables on the developers workstation (just make sure it stored in version control independent of the code). Each works well, it just depends on preference, there are a lot of ways one can set it up to work in their environment, just try a few and see which one best fits your development culture.
OK guess I'm a moron here but....surely the suggestion isn't that a huge set of env vars are entered at the console manually - they have to be in some shell script or file which produces them...which is then...the config file ! Someone help me see what I'm missing here.
Unless the idea is, "well it's a shell script! that's nothing like a config file!" in which case I'll be searching for the HN downmod button I can't wait to have someday.