Trigger GitLab CI/CD Pipelines from Container Registry
Release notes
There are a number of ways to trigger pipeline jobs currently (as listed in the table in this section of the documentation), but there is no trigger for a container registry update. Whenever an image is updated in a Container Registry in a GitLab site, there should be a way to detect that and reference that in pipelines on other projects.
Problem to solve
As a DevOps engineer, I want to be able to setup automatic re-runs of pipelines whenever a base Docker image - present in a GitLab container registry - is updated. This will allow developers to update the Docker image without worry, since all of the dependent images/deployments can be set to re-build automatically; and nothing will be out-of-date.
Note that the base Docker image in question may not be getting built from a GitLab CI/CD pipeline. That is why the pipeline trigger must correspond to a Container Registry state change itself.
Intended users
This will likely be useful for the following roles, especially in sprawling microservices projects.
Proposal
Should be a simple one-line trigger that can be added to the .gitlab-ci.yml
file, like this:
build_images:
stage: build
on:
docker_image: registry.gitlab.com/baseimage
run:
...
Links / references
Linked Issues:
This has been discussed previously here, but the discussion was discontinued and locked: gitlab-foss#31414 (moved)