Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two gitlab-ci runners for one project

I used to have a project on github with a travis and an appveyor integration service configured. Thus I was able to make sur my project was compiling ok on both OSX and Windows plateform.

I'm now working with gitlab and ci runners. I have two runners configured:

  • One on a OSX machine
  • One on a Windows machine

Unfortunately when I add both runners in my project settings > CI/CD > Runners settings, only one is triggered upon push (the OSX one).

If I disable the OSX runner, the Windows runner is triggered fine.

like image 501
Martin Delille Avatar asked Jan 03 '23 16:01

Martin Delille


1 Answers

One Job is only running by one runner.

I guess you want that your Job is running twice

  1. on your windows runner
  2. on your osx runner

To do so

  1. Tag your runners (e.g. win and mac)
  2. duplicate your job for the same stage and add for your windows runner job the win tag and for your mac runner job the mac tag.

This should take care that both runners will run the job in the next pipeline.

stages:
  - build

mac_build:
  stage: build
  tags:
    - mac
  script:
    - something ...

win_build:
  stage: build
  tags:
    - win
  script:
    - something ...
like image 179
Markus Avatar answered Jan 05 '23 05:01

Markus