myke
myke copied to clipboard
discovery: top-level .env files ignored in discovered tasks
Example
With this directory structure
root/
├── myke.yml (A)
├── myke.env.local (C)
└── sub/
└── myke.yml (B)
(A) being :
project: root
discover:
- sub
(B) being :
project: sub
tasks:
deploy:
cmd: echo "deploy with {{.OPTIONAL_ARGS}}"
(C) being :
OPTIONAL_ARGS="myOptionalArgs"
Current behaviour
cd root && myke deploy
will return "deploy with "
.
root/myke.env.local
will be ignored for tasks that are discovered in subs
Behaviour I expect
cd root && myke deploy
to return "deploy with myOptionalArgs"
.
Current workarounds
If we want myke
to pick up the extra args, we have to do one of the following :
-
OPTIONAL_ARGS="myOptionalArgs" myke deploy
which is slightly verbose. Orexport
orsource
to inject it in the env ourselves. - proxy our
sub/task
with a task inroot/myke.yml
which kind of makes discovery useless. - move our
root/myke.env.local
tosub/
. But in real life we have many of those.
Other cases
Additional myke.env.local in sub
root/
├── myke.yml (A)
├── myke.env.local (C)
└── sub/
├── myke.yml (B)
└── myke.env.local (D)
I believe values in (C) should override values in (D), when conflicting. Means export values in (D) first, then values in (C).