add --env & config option to set values in all task environments #517
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@jgadling building on your much-appreciated #516, I extended it to work just like
docker run --env
:--env X
to pass through environment variableX
, skipping ifX
is undefined--env X=foo
to setX
outright--env
multiple times with different variablesLet me know if you have any concerns with this variation on it!
While hacking on this, I remembered how miniwdl passes AWS credentials to its internal S3 downloader: it generates a temporary script file defining the necessary environment variables, then sources that script at the start of a task that needs it. The advantages of this approach are (i) it's concise yet explicit that the task needs this information supplied and (ii) miniwdl is careful never to dump file contents into its log in case they contain sensitive information. Just another concept to consider, however, I also support this passthrough feature.