-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Currently the only way to run lets with predefined specific env variables is to use sh, for example:
Env script .env.sh
export MY_ENV=123lets.yaml
In this case MY_ENV exists.
commands:
run: echo ${MY_ENV}But the problem that if I want to explicitly tell lets command which env vars I expect, there is only one way using sh
This does not work - it prints ${MY_ENV}
commands:
env:
MY_ENV: ${MY_ENV}
run: echo ${MY_ENV}This work - it prints 123
commands:
env:
MY_ENV:
sh: echo ${MY_ENV}
run: echo ${MY_ENV}We have two options:
- Add env interpolation such as in docker-compose so this will print 123, but the problem is that this requires distinguish between local and interpolated vars. Docker compose uses $$ to access local vars. I do not want to add this right now.
commands:
env:
MY_ENV: ${MY_ENV}
run: echo ${MY_ENV}- Add support for dotenv. This can be implemented in two ways:
First: here we are declaring env and env_file - so env can interpolate vars from file
commands:
env:
MY_ENV: ${MY_ENV}
env_file: .env
run: echo ${MY_ENV}Second: or we can just populate env from env_file. This I like most - because it does not requires us to implement interpolation right now, it is just appends env from file to existing env.
Questions:
- What priority env_file has ?
- Do we need env_file global keyword ?
commands:
env_file: .env
run: echo ${MY_ENV}Metadata
Metadata
Assignees
Labels
No labels