I am trying to have 2 runners on different machines set up for the same project for our production environment. Both runners are successfully registered but it looks like only one of them will pick up the job. There is no pattern which of the 2 runners will pick up, its random… So I assume the first runner to see the job will pick it up while the other will ignore it.
Both runners share the same tag ‘production’ and are limited to the branch ‘production’ with the ‘only’ keyword in the .gitlab-ci.yml file:
deploy-production:
stage: deploy
script:
- some magic
tags:
- production
only:
- production
Is there a way to have both runners pick up the same job?
No one is replying so maybe I am approaching this wrong? My goal is to deploy the same build to both production machines that share the load behind a load balancer. Is there another/preferred way to achieve this?
I have two runners registered on two servers with different environments (e.g. different compilers).
I would like the same job to be “sent” to both runners as can be done easily with buildbot for example…
Jobs are only run once by one runner. That’s just how jobs work.
if you need something done on multiple machines, you have two choices:
Make one job that does all that needs to be done
Make multiple job, and if the job needs to be executed on different machines use a corresponding number of tags to make them picked up by those machnes.