Skip to content

Pass host variables to the job (docker executer)

Description

The host defines a variable with a host-specific IP, which should be used for exposing a container on the particular host, for example:

$ env | grep ANNOUNCED_IP
ANNOUNCED_IP=38.xx.xx.13

The current workaround is to duplicate the configuration in the runner.

[[runners]]
  environment = ["ANNOUNCED_IP=38.xx.xx.13"]

Proposal

It would be very helpful to have some syntax to pass variables from the host to the job, for example:

[[runners]]
  environment = ["MY_VAR"] # without value assignment there

or:

[[runners]]
  environment = ["MY_VAR=$MY_VAR"] # explicit variable expansion

Links to related issues and merge requests / references