up icon indicating copy to clipboard operation
up copied to clipboard

Per-stage environment variables in up.json

Open tj opened this issue 6 years ago • 1 comments

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?

tj avatar Nov 08 '19 11:11 tj

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

  1. Stage specific in up.json
  2. up env
  3. Global up.json

That would be weird.

Prinzhorn avatar Dec 18 '19 11:12 Prinzhorn