Loading gitlabci_local/parsers/gitlab.py +10 −1 Changes for gitlabci_local/parsers/gitlab.py: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -78,10 +78,19 @@ class GitLab: for key in additions: # Handle included expanding data if key in base and isinstance(additions[key], dict) and key in ['variables']: if key in base and isinstance(additions[key], dict) and key in [ 'variables', ]: data[key] = base[key] data[key].update(additions[key]) # Handle included local data elif key in base and isinstance(additions[key], dict) and key in [ GitLab.LOCAL_NODE, ]: data[key] = base[key] GitLab.__merges(data[key], additions[key]) # Handle included overriding data else: data[key] = additions[key] Loading tests/includes/.gitlab-ci.local.yml 0 → 100644 +11 −0 Changes for tests/includes/.gitlab-ci.local.yml: 11 added lines, 0 removed lines. Original line number Diff line number Diff line include: - local: '/job_local.yml' stages: - includes .local: no_verbose: true variables: VARIABLE_2: 'OVERRIDE_2' VARIABLE_3: 'VARIABLE_3' tests/includes/job_local.yml 0 → 100644 +18 −0 Changes for tests/includes/job_local.yml: 18 added lines, 0 removed lines. Original line number Diff line number Diff line .local: variables: VARIABLE_1: 'VARIABLE_1' VARIABLE_2: 'VARIABLE_2' 'Job 1': stage: includes image: local:quiet script: - set -x - echo 'Job 1' - echo "VARIABLE_1=${VARIABLE_1}" - echo "VARIABLE_2=${VARIABLE_2}" - echo "VARIABLE_3=${VARIABLE_3}" - test -z "${VARIABLE_1}" && exit 1 || true - test -z "${VARIABLE_2}" && exit 1 || true - test -z "${VARIABLE_3}" && exit 1 || true - test "${VARIABLE_2}" = 'OVERRIDE_2' tests/includes/test.sh +1 −0 Changes for tests/includes/test.sh: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ gitlabci-local -c ./.gitlab-ci.default.yml -p gitlabci-local -c ./.gitlab-ci.dict.yml -p gitlabci-local -c ./.gitlab-ci.empty.yml -p gitlabci-local -c ./.gitlab-ci.list.yml -p gitlabci-local -c ./.gitlab-ci.local.yml -p gitlabci-local -c ./.gitlab-ci.nested.valid.yml -p gitlabci-local -c ./.gitlab-ci.nested.missing.yml -p && exit 1 || true gitlabci-local -c ./.gitlab-ci.nested.loop.yml -p Loading Loading
gitlabci_local/parsers/gitlab.py +10 −1 Changes for gitlabci_local/parsers/gitlab.py: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -78,10 +78,19 @@ class GitLab: for key in additions: # Handle included expanding data if key in base and isinstance(additions[key], dict) and key in ['variables']: if key in base and isinstance(additions[key], dict) and key in [ 'variables', ]: data[key] = base[key] data[key].update(additions[key]) # Handle included local data elif key in base and isinstance(additions[key], dict) and key in [ GitLab.LOCAL_NODE, ]: data[key] = base[key] GitLab.__merges(data[key], additions[key]) # Handle included overriding data else: data[key] = additions[key] Loading
tests/includes/.gitlab-ci.local.yml 0 → 100644 +11 −0 Changes for tests/includes/.gitlab-ci.local.yml: 11 added lines, 0 removed lines. Original line number Diff line number Diff line include: - local: '/job_local.yml' stages: - includes .local: no_verbose: true variables: VARIABLE_2: 'OVERRIDE_2' VARIABLE_3: 'VARIABLE_3'
tests/includes/job_local.yml 0 → 100644 +18 −0 Changes for tests/includes/job_local.yml: 18 added lines, 0 removed lines. Original line number Diff line number Diff line .local: variables: VARIABLE_1: 'VARIABLE_1' VARIABLE_2: 'VARIABLE_2' 'Job 1': stage: includes image: local:quiet script: - set -x - echo 'Job 1' - echo "VARIABLE_1=${VARIABLE_1}" - echo "VARIABLE_2=${VARIABLE_2}" - echo "VARIABLE_3=${VARIABLE_3}" - test -z "${VARIABLE_1}" && exit 1 || true - test -z "${VARIABLE_2}" && exit 1 || true - test -z "${VARIABLE_3}" && exit 1 || true - test "${VARIABLE_2}" = 'OVERRIDE_2'
tests/includes/test.sh +1 −0 Changes for tests/includes/test.sh: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ gitlabci-local -c ./.gitlab-ci.default.yml -p gitlabci-local -c ./.gitlab-ci.dict.yml -p gitlabci-local -c ./.gitlab-ci.empty.yml -p gitlabci-local -c ./.gitlab-ci.list.yml -p gitlabci-local -c ./.gitlab-ci.local.yml -p gitlabci-local -c ./.gitlab-ci.nested.valid.yml -p gitlabci-local -c ./.gitlab-ci.nested.missing.yml -p && exit 1 || true gitlabci-local -c ./.gitlab-ci.nested.loop.yml -p Loading