Gitlab CI - Specifying Runner Per Job

503 Views Asked by At

We are currently facing a conundrum with our multi-tenant project which contains various configuration files for each of our tenants and their associated environment. Our CI/CD Pipeline is split into two parts

  • An Upstream pipeline which analyses the new commit to master to determine which tenants/environments have been changed. This triggers the downstream pipeline with the correct environment variables via the API
  • A downstream pipeline which executes scripts to deploy changes to the tenants' environment based on the environment variables passed through. This works well, however we have a Gitlab Runner per environment to access the customers environment. We use this to avoid hard-coding multiple credentials within our scripts or CI environment variables.

Is there a way we can trigger this downstream pipeline with the specific Gitlab Runner? Our Gitlab Runners are tagged per environment so that we can use the passed environment variables to detect which runner it should be ran on.

I’ve had a look around the Gitlab CI, specific runners and shared runners (which ours are currently) but doesn’t seem to be supported.

1

There are 1 best solutions below

0
On

tags: supports variable expansion. So, it is possible to pass variables in the API call when creating your downstream pipelines in order to control which runners are used.