Did setting a STAGE and stage fallback change in Jovo 3?

cli

#1

My understanding is the following affects the stage chosen in the following order:

  1. If --stage is passed as a param to Jovo CLI (get, build, deploy, run), use it
  2. If not, use the value in project.js for defaultStage
  3. If that does not exist, use env var: STAGE
  4. If that does not exist, use env var: NODE_ENV

@AlexSwe @jan

Is that correct?

Did any of that change for Jovo 3?
Seems like in Jovo 2 that defaultStage could be overriden with STAGE

What is the JOVO_STAGE env var for?


#2

Hi @marktucker,

Thanks for flagging this. Seems like a bug. We need to make this consistent across the Jovo CLI (project) and Jovo App (runtime) staging and our documentation. cc @AlexSwe @rubenaeg

  1. STAGE was renamed to JOVO_STAGE and needs to work across the CLI and the framework
  2. NODE_ENV should also be possible to use as it is convention in other web frameworks

#3

Hey @marktucker

Always thankful for your help. Yes, that is the order of the stage variable. We haven’t changed the order in the update. JOVO_STAGE has been used in the framework for some time but wasn’t fully consistent with the cli. (I will fix some things and it will be available with the next update) We added it to avoid conflicts with other tools using STAGE environment variables.

This is/will be the order

  1. If --stage is passed as a param to Jovo CLI (get, build, deploy, run), use it
  2. If not, use the value in project.js for defaultStage
  3. If that does not exist, use env var: JOVO_STAGE
  4. If that does not exist, use env var: STAGE
  5. If that does not exist, use env var: NODE_ENV