up
up copied to clipboard
Per-stage environment variables in up.json
Currently you can't define these per-stage, only with up env .... Ideally you can define them in the stage, and at the root level and they merge.
I'm not sure if precedence should be given to up env's, or the up.json but probably the up.json would be the most clear?
After #785 I just wanted to ask for exactly this :D
Regarding precedence: I personally assume everything under stages to be merged into the top level up.json depending on the stage. Essentially
Object.assignRecursively(finalJson, upJson, stageSpecificJson)
What I'm trying to say is that adding support for stage specific environment variables shouldn't affect precedence at all and is not a question that needs to be asked. I assume there currently already is a precedence implemented (I haven't used up env) which would just stay exactly as is. Otherwise you'd weirdly interleave up env and up.json.
So what we don't want is a precedence like this
- Stage specific in up.json
up env- Global up.json
That would be weird.