To manager many env files.
Example:
# Initialize some environments
$ cat `FOO=biz` > .envs/staging
$ cat `FOO=taz` > .envs/rc
# Initialize the template file (Optional)
$ cat 'PORT=300\nFOO=' > .envs/template
# Now choice one
$ envctl use stagingbrew install jondotsoy/core/envctl- Make your sources write many
.envs/<source_name>files. - Write your template on
.env.template
Example:
# find .*
.env.template
.env.staging
.envs/rc1
.envs/rc2
- Now run the next command
envctl use <staging|rc1|rc2>to write the final.envfile and enjoy.
The template is used to make a .env file in the workspace directory. This file is filed with the envctl use command.
For security, the
envctl usecommand never adds variables to the final.envfile.
Templates locations:
The envctl use find the template on the next alternatives:
.envs/template.env.template.env.sample.env.example
If a template does not exist, it will try to use the .env file as a template. This strategy is so useful to update the template only on local.
A source is used to fill a template and make the final .env file.
Those are valid sources:
.env.foo.foo.env.envs/foo.envs/.foo.envs/foo.env.envs/.foo.env
Use that you prefer.
Preferably, add
.envs/on your.gitignorefile to prevent pushing the secrets.