Problem to solve
artifacts:reports:dotenv
does not pass an environment variable to another job if artifacts:access
is developer
in the origin job.
This is the output of test-job
.
Line 19 display the environment variable value passed by build-job
(artifacts:access
is all
). But the value of environment variable BUILD_VARIABLE_WITH_DEVELOPER_ACCESS
is not displayed (artifacts:access
is developer
)
Configuration
build-job:
stage: build
script:
- echo "BUILD_VARIABLE=value_from_build_job" >> build.env
artifacts:
reports:
dotenv: build.env
build-job-with-developer-access:
stage: build
script:
- echo "BUILD_VARIABLE_WITH_DEVELOPER_ACCESS=value_from_build_job_with_developer_access" >> build-with-developer-acccess.env
artifacts:
access: developer
reports:
dotenv: build-with-developer-acccess.env
test-job:
stage: test
script:
- echo "$BUILD_VARIABLE"
- echo "$BUILD_VARIABLE_WITH_DEVELOPER_ACCESS"
Versions
Please select whether options apply, and add the version information.
- Self-managed
- GitLab.com SaaS
- Self-hosted Runners
Versions
- GitLab: Enterprise Edition v17.2.0-ee
- GitLab Runner, if self-hosted: 17.1.0