brick icon indicating copy to clipboard operation
brick copied to clipboard

Environment variable error appear even if variable is not used for current step

Open corradio opened this issue 5 years ago • 2 comments

To reproduce:

  1. add an BRICK_ env variable as part of a command in the build step
  2. run the prepare step without the env variable (brick prepare)
  3. brick will crash saying that the variable isn't defined

Expected behaviour: Prepare step should run fine.

corradio avatar Jan 06 '21 15:01 corradio

We currently expand variables once for the entire config. A bit of a tradeoff.

But we haven't really had an issue with it as we usually use default values:

  commands:
      - REACT_APP_COMMIT_SHA=${BRICK_COMMIT_SHA:-unknown} yarn build

skovhus avatar Jan 06 '21 15:01 skovhus

We currently expand variables once for the entire config. A bit of a tradeoff.

But we haven't really had an issue with it as we usually use default values:

  commands:
      - REACT_APP_COMMIT_SHA=${BRICK_COMMIT_SHA:-unknown} yarn build

good call, I'll do that!

corradio avatar Jan 06 '21 17:01 corradio