A derived version of gitlab-runner tailored for running as a Docker swarm service.
Based on the alpine tag, it basically adds an automatic registration if the config file does not exists. The registration will be performed non-interactively using environment variables to set various options.
The following variables must be defined in order to have a working runner:
CI_SERVER_URL
: the url of the Gitlab serverREGISTRATION_TOKEN
: registration token from the Gitlab server aboveCI_SERVER_TOKEN
: an alternative toREGISTRATION_TOKEN
the value should be the one found in an existingconfig.toml
from an already registered runner
The following variables are already defined to sensible values but can be overridden.
DOCKER_PRIVILEGE=true
RUNNER_EXECUTOR=docker
DOCKER_IMAGE=docker:git
DOCKER_VOLUMES=DOCKER_VOLUMES
DOCKER_VOLUME
and RUNNER_ENV
should allow to create an array of strings in config.toml
. However as explained in issue #259 the runner is not able to split the variable into a TOML array. In order to work around this, the following workaround is implemented:
- The base variable should contain the first entry for instance:
DOCKER_VOLUMES=DOCKER_VOLUMES
. - Additional entries should be placed in a variable suffixed by
_EXTRA
. The entries should be in TOML syntax that is between double quotes and separated by commas (,
). For instance:RUNNER_ENV_EXTRA="A=B","C=D"
.
This code is distributed under the MIT license, see the LICENSE file.