My gitlab version is 13.8.3.
I try to pass CI/CD variables to a downstream pipeline according to official documentation.
Test case: pass variable VARIABLE_FROM_UI to downstream pipeline.
ER:
-
Run pipeline from web interface and set VARIABLE_FROM_UI=123
echo command in downstream pipeline prints 123 -
Run pipeline from web interface and keep default empty value
echo command in downstream pipeline prints nothing
AR:
-
Run pipeline from web interface and set VARIABLE_FROM_UI=123
echo command in downstream pipeline prints 123 -
Run pipeline from web interface and keep default empty value
echo command in downstream pipeline prints $VARIABLE_FROM_UI
Is this a bug or I do something wrong ?
I tried to search some topics or issues about it, but didn’t find anything
My ci files are below
.gitlab-ci.yml file
default:
image: "<my_private_centos_image>"
tags:
- runner
variables:
VARIABLE_FROM_UI:
value: ""
description: "Some variable"
stages:
- parent
- child
parent:
stage: parent
script:
- echo '1'
artifacts:
paths:
- ./generated-ci.yml
child:
stage: child
variables:
VARIABLE_FROM_UI: $VARIABLE_FROM_UI
trigger:
include:
- artifact: generated-ci.yml
job: parent
strategy: depend
generated-ci.yml file
default:
image: "<my_private_centos_image>"
tags:
- runner
stages:
- inner
variables:
VARIABLE_FROM_UI:
value: "false"
description: "Some variable"
inner:
stage: inner
script:
- echo "*********"
- printenv
- echo $VARIABLE_FROM_UI
- echo "*********"