Bad wording in the documentation about the anchors of gitlab-ci
In the current documentation of Gitlab-CE (Gitlab-CI), we can use the anchors, define them and use them if we want to merge them in an other configuration.
https://docs.gitlab.com/ee/ci/yaml/README.html#anchors
.job_template: &job_definition
variables:
POSTGRES_USER: user
script:
- set
job:
<<: *job_definition
variables:
POSTGRES_PASSWORD: password
with the Linter in the CI, there is no issue but when we execute the job, the variables from the job_definition will override the defined variables (from job_definiton), and in this case, we can not override some variables.
gitlab-runner exec docker job
Runtime platform arch=amd64 os=linux pid=24462 revision=cf91d5e1 version=11.4.2
WARNING: You most probably have uncommitted changes.
WARNING: These changes will not be tested.
Running with gitlab-runner 11.4.2 (cf91d5e1)
Using Docker executor with image python:3.5 ...
Pulling docker image python:3.5 ...
Using docker image sha256:ffc8b495cd265f91c959a28b7540d8cf191b83884ef2fb921d2f371a5c37782a for python:3.5 ...
Running on runner--project-0-concurrent-0 via xps...
Cloning repository...
Cloning into '/builds/project-0'...
done.
Checking out b4f1bc3c as test-docs...
Skipping Git submodules setup
$ set | grep POSTGRES
POSTGRES_PASSWORD=password
_=$'\E[32;1m$ set | grep POSTGRES\E[0;m'
Job succeeded
Edited by Stéphane Wirtel