From Copy-Pasted YAML to a CI/CD Catalog
I started my DevOps internship in February. The first weeks were mostly GitLab CI: reading other people's .gitlab-ci.yml files and adding scanners to them, Semgrep and Trivy first, then SonarQube and DefectDojo.
Almost every one of those files was a copy of another one with a few edits. That's a fine way to start a pipeline, but it gets worse with every new service. A fix lands in one repo and never reaches the others. One service still pins an old Trivy, another has renamed its deploy job, a third never got a scan job at all. By April, upgrading a scanner meant opening a merge request in every repo.
This post is about how our DevOps team moved every project onto one shared library of GitLab CI/CD components, the catalog I started building in May, and what broke along the way.

April: a shared templates repo
The first step was the usual one. In April I moved the repeated jobs into a single templates repo, and services pulled them in with include: project:
include:
- project: platform/ci-templates
file: /templates/scan-image.yml
That removed most of the copying. A few days later it also broke the dev team's pipelines. An include: project only works if whoever runs the pipeline can read the included repo, and they couldn't. Until the permissions were sorted out, I ran their pipelines by hand.
While I was dealing with that, I started reading about GitLab's CI/CD components and the CI/CD Catalog.
May: moving to components
GitLab had more or less made the decision for me. Its guide for CI/CD templates now says:
With the introduction of the CI/CD Catalog, GitLab is no longer accepting contributions of new CI/CD templates to the codebase. Instead, we encourage team members to create CI/CD components for the catalog.
Components also gave us things the templates repo didn't have. Each one is a single file under templates/ with a spec header for its description and inputs, so they all have the same shape. Published components are listed in the CI/CD Catalog with their README. And a catalog release has to be a semantic-version tag, which makes a version something you publish on purpose instead of whatever happens to be on main.
A component looks like this:
spec:
description: Scan a container image with Trivy.
inputs:
image:
description: Image to scan
severity:
default: HIGH,CRITICAL
---
scan-image:
stage: test
image: aquasec/trivy:0.76.0
script:
- trivy image --exit-code 1 --severity $[[ inputs.severity ]] $[[ inputs.image ]]
And a service uses it like this:
include:
- component: $CI_SERVER_FQDN/platform/ci-catalog/scan-image@$CATALOG_VERSION
inputs:
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
I planned the move in mid-May and had a first version working a few days later. The next week went into testing it on a real frontend service.
What broke after the first release
Testing on one service didn't catch everything. Once more services moved onto the catalog, a few problems showed up:
- Deploys that worked only sometimes. A day after the first release, deploys to Nomad, where a few services still ran then, started failing at random, with nothing changed in between. The registry login used the CI job token, which expires when the job ends, and Nomad pulled the image after that. Whether a deploy worked came down to timing.
- Pushes failing in repos nobody had touched. About two months in, image pushes started failing with
blob unknown to registry, in repos where nothing had changed. The build job useddocker:latest, andlatesthad moved to a new version underneath us. Pinning it fixed the pushes, and every image in the catalog is pinned to a version now. - The same findings, again and again. A month later, I noticed DefectDojo filling up with the same findings over and over. Each pipeline run was importing its results as new findings instead of re-importing them into the existing test, so the numbers grew with every run and nobody could tell what was actually new. I changed the upload component to re-import into the existing test under a CI/CD engagement, and cleaned out the duplicates.
- Two repos sharing one SonarQube project. About four months in, I found two repos reporting into the same SonarQube project. Project keys were cut at 63 characters, and both repo paths shared the first 63, so each scan overwrote the other's results.
- A scanner killed mid-clone. Two weeks later, Semgrep started getting OOM-killed while cloning one large repo on our Kubernetes runners. The fix was more memory for the runner's helper container and a shallow clone (depth 20) for Semgrep and Gitleaks. SonarQube still clones the full history, because it uses Git blame to tell new code from old.
Apart from the runner memory, each fix went into the catalog once and reached every service through a version bump.
Rolling out a new version
Notice the $CATALOG_VERSION in the include above. It isn't hard-coded in each repo. It's a CI/CD variable set once at the group level, so releasing a fix to every service is one change: bump the variable. A project that isn't ready sets its own value and stays on the older version until it is.

The downside is that a bad release reaches everyone at once. That's why every release runs through the catalog's own test pipeline before it's published.
Where it is now
At the end of November 2026:
- 22 components covering build, test, scan, deploy and release
- 32 releases
- 25+ services on it, across development, staging and production
- a new service's pipeline is mostly a list of components and their inputs
What I'd do differently
I'd skip the templates repo and start with components. That month taught me a lot, but it cost us a second migration.