gitlab-docker-autodep
Automatically rebuild all the downstream dependencies of Docker-based projects on a Gitlab instance.
It scans all repositories containing a Dockerfile looking for FROM lines and navigates the resulting dependency tree to find all projects that needs to be rebuilt when their base image (or an upstream image thereof) changes.
By default, since it is meant to be used as a trigger as the last step in a CI script, it will not navigate the dependency tree recursively but only look at the first-level dependencies: this way, further CI pipelines downstream will each trigger their own deps once the image has been rebuilt.
Usage
Install the tool either in a virtualenv of or system-wide with:
sudo python setup.py install
This will install the gitlab-docker-autodep command-line tool.
Invoke the tool by pointing it at your Gitlab instance with the --url command-line option, and passing the path of the repository you want the dependencies of as an argument. This should be the full repository path including the namespace, not the full URL (e.g. group/projectname).
You can pass an authentication token using the --token command-line option.
The tool will only examine Docker images hosted on the Docker registry associated with the Gitlab instance. By default the registry name is automatically derived from the server URL (adding a registry prefix), but it can be changed with the --registry command-line option.
The tool will print out the project names of the dependencies it found, and it will also trigger a rebuild if the --rebuild option is specified.