Working with environment variables ¶
In a project-focused conception RKD is allowing to define environment variables in three places.
1) Dotenv ¶
.env
file is loaded on each RKD startup from directory, where
./rkdw
is launched.
2) Document scope ¶
When operating on YAML there is a possibility to define a makefile-scoped environment variables, inline and loaded from dotenv file.
version: org.riotkit.rkd/yaml/v1
environment:
STOP: "Police brutality"
env_files:
- .env-prod
tasks: {}
3) Task scope ¶
version: org.riotkit.rkd/yaml/v1
tasks:
:task1:
environment:
STOP: "Police brutality"
env_files:
- .env-prod
steps: |
echo "STOP: ${STOP}"
4) Operating system scope ¶
Traditional, expected way how to pass the environment variables.
STOP="Police brutality" ./rkdw :task1
Priority ¶
Later has higher priority.
-
Dotenv loaded at startup
-
Document scope
-
Task scope
-
Operating system