build-job-single:
stage: build
script:
- echo "TEST_SINGLE=true" > single.env
artifacts:
reports:
dotenv: single.env
test-job-single:
stage: test
needs:
- build-job-single
script:
- |
if [ "$TEST_SINGLE" != "true" ]; then
echo "TEST_SINGLE is not set to true"
exit 1
fi
build-job-multi:
stage: build
script:
- echo "TEST_MULTI_1=true" > multi1.env
- echo "TEST_MULTI_2=true" > multi2.env
artifacts:
reports:
dotenv:
- multi1.env
- multi2.env
test-job-multi:
stage: test
needs:
- build-job-multi
script:
- |
if [ "$TEST_MULTI_1" != "true" ]; then
echo "TEST_MULTI_1 is not set to true"
exit 1
fi
if [ "$TEST_MULTI_2" != "true" ]; then
echo "TEST_MULTI_2 is not set to true"
exit 1
fi
Expected behaviortest-job-multi should not fail
Host information
Ubuntu
gitlab-ci-local 4.47.0
Additional context
While dotenv artifacts are supported, it will only work if a single dotenv file is present. once dotenv contains an array of files, environment variables will not be loaded in dependend jobs.
Minimal .gitlab-ci.yml illustrating the issue
Expected behavior
test-job-multi
should not failHost information Ubuntu gitlab-ci-local 4.47.0
Additional context While dotenv artifacts are supported, it will only work if a single dotenv file is present. once
dotenv
contains an array of files, environment variables will not be loaded in dependend jobs.