How to assign specific runner for specific environment?

Hi all, I am new here :slight_smile:

I was trying to assign a windows runner to an environement via the gui, in order to have a form of control of where my code will deployed.

In the GUI I can add ‘agents’, where my current existing windows runners (set on the group level) are not visible.

Can on advise on how I can achieve this ?

Thanks in advance!

Runners allow to configure tags. You can then configure jobs to only run them when a tag matches. These jobs also specify the environment they run in. To avoid duplication, you could create a template job that gets inherited to all jobs.

.windows-job-tmpl:
  tags: [windows]
  environment: dev

job1:
  extends: .windows-job-tmpl
  # …

Hi, this could be a solution, but it won’t scale.
My use case, is that I have more then 100 customers. I want to run specific code on to one (or more) specific customer(s).
For this use case, TAGS are fine. BUT, in order to be able to track the status of the deployment per environment, I HAVE to use environments (this is how I understood the docs at least).

I tried to use

Contents of modelingtest.yml file located in another group / project.

.modelingtest:
  tags: 
    - 'modelingtest'
  environment: modelingtest

and then include it from my main ci file .gitlab-ci.yml

include:
  - project: 'plop/citools/environmentconfigs'
    file: '${CustomerName}.yml'
#...
deployInclude:
  extends: .modelingtest
  stage: deploy
  when: on_success
  script: .\plop.ps1
  rules:
    - if: "$deploy == $true"

This doesn’'t work,but what works though, is when I hardcode the value of the file like this

include:
  - project: 'plop/citools/environmentconfigs'
    file: 'modelingtest.yml'

but it defeats the purpose of what I am trying to accomplish.

Is there any other way I could achieve passing dynamically in the environment and the tag for a specific job without having to have to define 100 of template jobs in every single one of my project ? (More then 200)

@dnsmichi Is that maybe a feature that you guys would consider to implement ?
The feature already exists for docker containers.But not for normal runners.

It would make things SO MUCH easier I believe.

You can always propose a new feature, if no issue exists already.