Search code examples
gitlab-ci-runnergitlab-ci.yml

How to use any specific runner from the list in gitlab ci?


I have a list of specific gitlab runners. I want to create a ci script, which would pick one of them to run.

GitLab docs only tells how to run job with both tags, bot not with one of them.


Solution

  • Finally, I used a variable for a runner.

    So my config looks like this:

    variables:
        TAG_RUNNER: runner_one
    
    include:
      - project: 'gitlab_configs'
        file: '/reusable_script.yml'
    
    
    stages:
        - job
    

    reusable_script.yml:

    job:
        stage: job
        script:
            - script.sh
        tags:
          - $TAG_RUNNER