In GitLab ci, how to run shared runner if my specific runner is not available?

Viewed 337

I configured a specific runner for gitlab-ci on a local server. It worked like a charm, and it is 3 times faster that the shared runner on gitlab.com. So far, so great.

But I was wondering what will happen if my local server was not available. In this scenario, all the jobs of the pipeline will be in pending (waiting to the specific runner). If so, all projects deployments could be stuck for a while.

I tried some configurations in .gitlab-ci.yml to run the shared runner if my specific runner was not available. But all my tests failed.

What I did

My idea was to set 2 tags for the runners. The first one for my specific runner and the second one for the shared runner.

.tags: &tags
  - my-custom-runner
  - shared

But in this configuration, if my-custom-runner was not available, I had this error in the gitlab-ci job :

this job is stuck because you don't have any active runners

Has anyone figured out how to do this yet ? I didn't find related documentation on this topic.

Any help will be welcome. Thanks a lot.

Additional information

This configuration works if my-custom-runner is available :

.tags: &tags
  - my-custom-runner

This configuration works too and runs in the gitlab shared runner.

.tags: &tags
  - shared
0 Answers
Related