CI Variables set in Pipeline not appearing in Environment
Summary
Environment variables CI_ENVIRONMENT_NAME
and CI_ENVIRONMENT_URL
are not being correctly set from the pipeline. This appears to only have broken in the last week or so.
Steps to reproduce
In a pipeline, set the environment variables for environment:url
and environment:name
in a stage. Then, in that stage, run a script that echoes them. Example pipeline and shell script below
Example Project
In .gitlab-ci.yml:
before_script:
- if [ -f ./pipeline_functions.sh ]; then source ./pipeline_functions.sh; fi
Deploy to cluster:
environment:
name: test_name
url: https://www.fake-url.com
script:
- test_envir_var
In repository root, pipeline_functions.sh:
test_envir_var() {
echo CI_ENVIRONMENT_URL: "$CI_ENVIRONMENT_URL"
echo CI_ENVIRONMENT_NAME: "$CI_ENVIRONMENT_NAME"
}
What is the current bug behavior?
the pipeline stage prints empty values for both of these variables.
What is the expected correct behavior?
Pipeline would print:
CI_ENVIRONMENT_URL: https://www.fake-url.com
CI_ENVIRONMENT_NAME: test_name!
Relevant logs and/or screenshots
Screen_Shot_2020-03-25_at_10.11.23_AM
Output of checks
This bug happens on gitlab.com