I have a project where I’d have a large number of jobs which are highly similar:
.build-template: … job1: extends: .build-template variables: … job2: extends: .build-template variables: …
Extends works great for that but it only works for a single job and I’d like to add a second job which uses the same variables (e.g. "build foo; scan foo; build bar; scan bar; …”), and similarly since includes are global you can’t do something like include a template with multiple jobs.
This would be trivial to do with some kind of loop construct but it doesn’t look like there’s a better way to do it in GitLab CI than either combining the two job’s tasks (perhaps into a before/after script) or using a tool to generate the GitLab CI YAML file.
Has anyone found a better option?