I'm trying to print my variable MY_VAR value between two stages on my GitLab CI process. For that, I have the following stage:
build-1:
stage: build
image: ...
script: |
(
MYVAR="error">> build.env
)
artifacts:
reports:
dotenv: build.env
expire_in: 1 day
build-2:
stage: build
image: ...
script: |
(
echo "My variable: ${MYVAR}"
)
artifacts:
when: always
However, when I see my print on build-2 I got "My variable: ", so my variable returns empty value and it should returns "error". Am I missing something?
Thanks