Skip to content

RUNNER_ENV in bash script

Feature disposition status (2022-12-22)

We do not plan to implement this feature. To track plans related to the evolution of runner registration, follow this epic. Next GitLab Runner Token Architecture

I'm writing a bash script for automatically registering runner.

I can't solve the problem with RUNNER_ENV double-quotes escaping in generated config.toml

  1. RUNNER_ENV="VAR1=value1, VAR2=value2" gitlab-ci-multi-runner register -n ... gives environment = ["VAR1=value1, VAR2=value2"]

  2. RUNNER_ENV='"VAR1=value1", "VAR2=value2"' gitlab-ci-multi-runner register -n ... gives environment = ["\"VAR1=value1\", \"VAR2=value2\""]

Is there any correct way to pass several environment variables to runner's config.toml?

Edited by Darren Eastman