Dear community,
I’m facing an issue with parent global vars inheritance.
I have in parent pipeline:
###################################
## Vars
#
# I'm trying to overwrite this variable from child pipeline here
variables:
DISTRO: &deb_distros
- buster
- stretch
variables:
BUILD:
value: 'True' # either 'True' or 'False'
description: 'Runs build pipeline'
RELEASE: '1.0'
....
BUILD:
trigger:
include:
- project: 'common/pipelines'
ref: 'main'
file: 'build.gitlab-ci.yml'
strategy: depend
rules:
- if: $BUILD == 'True'
in the child pipeline
###################################
## Vars
#
variables:
DISTRO: &deb_distros
- bullseye
- buster
- stretch
variables:
DISTRO: &ubuntu_distros
- bionic
- focal
variables:
DISTRO: &rpm_distros
- centos8
- centos7
......
......
.BUILD:
stage: build
script:
- build.sh
BUILD_DEBIAN:
extends: .BUILD
parallel:
matrix:
- DISTRO: *deb_distros
artifacts:
paths:
- *.deb
BUILD_UBUNTU:
extends: .BUILD
parallel:
matrix:
- DISTRO: *ubuntu_distros
artifacts:
paths:
- *.deb
BUILD_RPM:
extends: .BUILD
parallel:
matrix:
- DISTRO: *rpm_distros
artifacts:
paths:
- *.rpm
I assume my parent pipeline DISTRO var will overwrite the child and I would have only 2 distros for build (buster and stretch), but I’m getting distros from the child pipeline and my build fails:
Appreciate any suggestion, thank you!