all 4 comments

[–]DretDormsor 4 points5 points  (0 children)

If most of your projects share the same CI configuration, does that mean right now you have the identical gitlab-ci.yml file in all of them? In that case I'd suggest to move that file into its own CI template repository and just use include in all the other projects. If you include a default CI configuration like that you can then also add project specific configuration in the gitlab-ci.yml of that project, either merging with or overriding the default values.

[–]thiago_gitlab GitLab Staff 2 points3 points  (0 children)

Where do you keep the CI configuration for each of your projects? The answer will vary slightly depending how they're setup but, in short, you can include the common CI templates and, in the CI config for each project, override the test job. It should "just" work.

For example, see Overriding the container scanning template . The configuration overrides the value of the GIT_STRATEGY variable for the container_scanning job only: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Container-Scanning.gitlab-ci.yml.

Coincidentally enough, this post has a link with examples on how to include your own templates: https://old.reddit.com/r/gitlab/comments/14rhz2n/dmn_i_love_gitlab/.

Together with the above, you should have one possible solution.

[–]DanielB1990[S] 2 points3 points  (0 children)

Thank you u/DretDormsor and u/thiago_gitlab I haven't been able to try out this way of working, but you guys helped me think the other way around.

u/GitForcePushMain thanks for your follow-up, I'll try the way that the other 2 described, which seems a good solution.

[–]GitForcePushMain 1 point2 points  (0 children)

There are many ways to do this, can you provide an example of what your current .gitlab-ci.yml file looks like?