1

My Gitlab project is using the Gitlab pipelines, and I would want to use a different Gitlab Runner depending on whether the trigger is a simple push, or e.g. a tag marking a release.

The idea is that the runner triggered by a push is only consuming a short processing time, whereas the release triggered pipeline is creating a lot of documentation and reports etc., and blocking the resources for hours. In that time, the lightweight runs would be pending.

Adding another machine to run the Runner is not an option due to license topics.

So I would look for a solution where I can configure in the gitlab-ci.yml which runner to use. Is that somehow possible?

Thanks!

1 Answer 1

0

Register Different runners with tags depending on their resources:

Example:

  • Lightweight Runner: Tag as lightweight
  • Heavyweight Runner: Tag as heavyweight

Use the same tags respectively in .gitlab-ci.yml

lightweight_job:
  stage: test
  script:
    - echo "Running lightweight job"
  tags:
    - lightweight

For heavyweight Use different tags:

heavyweight_job:
  stage: build
  script:
    - echo "Running heavyweight job"
    - ./generate-docs.sh
    - ./run.sh
  tags:
    - heavyweight

Also, you can use the rules keyword to determine when jobs should run based on the type of Git event, and then assign specific tags to each job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.