Unable to fetch custom variable values

Gitlab runner installed on Mac using homebrew:

$ gitlab-runner --version
Version:      13.7.0
Git revision: 943fc252
Git branch:   13-7-stable
GO version:   go1.15.6
Built:        2020-12-21T16:24:57+00:00
OS/Arch:      darwin/amd64

I’m trying to debug why I am unable to fetch the values of custom variables set in GitLab UI.

The executor is “docker”. The runner is definitely active:

$ gitlab-runner verify
Runtime platform                                    arch=amd64 os=darwin pid=83767 revision=738bbe5a version=13.3.1
WARNING: Running in user-mode.                     
WARNING: Use sudo for system-mode:                 
WARNING: $ sudo gitlab-runner...
Verifying runner... is alive                        runner=<redacted>

.gitlab-ci.yml snippet

  - echo $CI_JOB_STAGE
  - echo $MYSQL_HOST

results in

$ echo $CI_JOB_STAGE
$ echo $MYSQL_HOST

I have tried with adding, both in the job and separately (with the same result):


It doesn’t appear to be syntax, “MYSQL_HOST", "{MYSQL_HOST}”, ${MYSQL_HOST} do not work either.

These variables are available when I run the CI through git commits, but not on my locally installed gitlab-runner. They are not protected or masked and available for all environments.

As far as I understand from the docs, a locally hosted gitlab-runner should fetch the environment vars. Is this not the case?