Skip to content

Auto registration of multi-runner

Hello,

I want using advanced configuration in config.toml of multi-runner, for example - auto-scaling in digitalocean.

Example of config.toml:

[[runners]]
  executor = "docker+machine"
  url = "https://gitlab.example.com/ci"
  name = "auto-scale-runner-digitalocean"
  token = "***"
  limit = 3
  [runners.docker]
    image = "ubuntu"
  [runners.machine]
    IdleCount = 0
    IdleTime = 2700
    MaxBuilds = 10
    MachineDriver = "digitalocean"
    MachineName = "auto-scale-runners-%s.gitlab.example.com"
    MachineOptions = [
        "digitalocean-image=coreos-beta",
        "digitalocean-ssh-user=core",
        "digitalocean-access-token=***",
        "digitalocean-region=nyc2",
        "digitalocean-size=512mb",
        "digitalocean-private-networking",
        "engine-registry-mirror=https://registry.example.com/"
    ]

The main question about token from config. I uploaded this config and started multi-runner, but it doesn't work, because I must register my runner in gitlab. When I register multi-runner it added to config new [[runner]] and I must remove new [[runner]] and replace token in custom runner from new runner manually. It's very strange and not usable.

Can you describe please: how to automate it? I don't want to do it manually and write some scripts, but I can't get token without registration...

Explain please true way to working with advanced configuration and redeploy it to different instances.

Thanks, Anton