Martin Delille
Martin Delille

Reputation: 11780

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:

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.

Upvotes: 5

Views: 3691

Answers (1)

Markus
Markus

Reputation: 3148

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 ...

Upvotes: 10

Related Questions