I’ve been experimenting with using the include keyword in my CI pipeline to include templates that come with GitLab, such as code analysis and dependency scanning.
However the way the runners are configure in my system require the tags keyword to be used.
Is there anyway to include a template and tell it to use a particular tag?
You can certainly do this by just defining the job that you’re including again after the include. For example, if I want to include the Code Quality job from Auto DevOps but ensure that its only run on a Runner tagged with linux I’d do the following.
include:
- template: Jobs/Code-Quality.gitlab-ci.yml
code_quality:
tags:
- linux