Search code examples
gitlabgitlab-cigitlab-ci-runner

Disable a gitlab-runner for a project


I have a private gitlab group which has two runners configured.

One runner runs anything on that group and the second one just picks jobs with tag long-running.

Below is the simplest gitlab ci file

stages:
  - build
sample:
  stage: build
  image: alpine:latest
  tags:
    - long-running
  variables:
    GIT_STRATEGY: none
  script:
    - echo "task executed."

Is there a way I can make the first one skip this job completely?

I know that I can disable the runner for this project alone but that would mean I have to manually enable the runner for all the 100+ projects in the group.

Does the specific runner have a priority? I would be pretty much happy with that :)

Or is there a workaround to make sure that the second alone picks the jobs with that tag. Searched a little but didn't find any simpler explanation. Thanks in advance


Solution

  • I didn't find much help on this. But however, we have followed a workaround. We created a new runner specific to that project.

    Then we have set concurrent = 2 found at /etc/gitlab-runner/config.toml. We are now able to have 2 concurrent non-blocking runners. However, I know that this is not the optimal solution. Still looking for ways to block a runner from picking jobs with tags. Hope this helps.