Versioning Gitlab CI/CD Pipelines

I show how you can version gitlab-ci.yml files for scalable resuse across many projects

Thomas Chinery by Thomas Chinery on April 19, 2024
Content for my site is based on Digital Gardening. This is a pre-release version of this content and may be incomplete. This article will be updated. Stay tuned and thank you for taking a look.

The gitlab-ci.yaml file is present in almost every Gitlab project I work on.

Often a pipeline is generic to specific type of project and in this scenario it would be wise to reference a singular gitlab-ci.yaml file.

Most Engineers I’ve worked with copy and paste the gitlab-ci.yaml file across projects which of course is error prone and drives inconsistencies when working with many projects.

Gitlab allows you to reference a gitlab-ci.yaml from a different project - I often create a Pipeline Templates project for this. Not only that but you also reference specific versions meaning you can roll out and test versions on one project first without touching the rest.