Allow setting environment variables
Currently, environment variables can be set on a per-task basis with most shell interpreters using the env
command or something similar. This is suboptimal for a few reasons:
- it's often clunky to read, and makes the
script
strings noisier - you often want to set environment variables for more than one task, and currently have to duplicate the code for this on every task
- doesn't work with
interpreter
s that aren't a normal shell
I'm thinking we could add a new env
key, which is allowed at all levels: globally, per-group, and per-task. Schema would look something like this:
env = { FOO = 0 }
[[group]]
name = a
env = { FOO = 1, BAR = 2 }
[[group]]
name = b
[[task]]
name = "task-1"
group = "a"
# executes with FOO=1 BAR=2
[[task]]
name = "task-2"
group = "b"
# executes with FOO=0
[[task]]
name = "task-3"
group = "a"
env = { BAR = 3 }
# executes with FOO=1 BAR=3