Skip to content

Global Variables overridden by Job variables, any chance for merge?

Currently if you have the following:

variables:
  PUPPET_GEM_VERSION: '4.10.1'
  STRICT_VARIABLES: 'no'
  DOCKER_DRIVER: 'overlay'
  DOCKER_HOST: 'tcp://docker:2375'


acceptance:
  variables:
    BEAKER_VERSION: git://github.com/puppetlabs/beaker.git#master
    PUPPET_INSTALL_TYPE: agent
    PUPPET_INSTALL_VERSION: 1.10.1

Based on the documentation in order to remove global variables would be the following (https://docs.gitlab.com/ee/ci/yaml/README.html#job-variables) but doesn't clearly state that setting anything will override all the existing variables and require them to be redeclared:

acceptance:
  variables: {}

Looking to find out how to merge these... maybe something like &variables to get from global?

variables:
  PUPPET_GEM_VERSION: '4.10.1'
  STRICT_VARIABLES: 'no'
  DOCKER_DRIVER: 'overlay'
  DOCKER_HOST: 'tcp://docker:2375'


acceptance:
  variables:
    &variables
    BEAKER_VERSION: git://github.com/puppetlabs/beaker.git#master
    PUPPET_INSTALL_TYPE: agent
    PUPPET_INSTALL_VERSION: 1.10.1