This repository has been archived on 2020-03-09 . You can view files and clone it, but cannot push or open issues or pull requests.
Docker image upgrade tool
The goal of this script is to make sure we use the latest available docker image for all containers.
It works as follows:
- Loop through git repositories where Drone CI is enabled
- Get the
Dockerfile
of each git repository and get the docker base image (this is specified in theFROM
LINE in the Dockerfiles) - Try to find the
docker-compose.yml
file and get images pulled from remote registries - Connect to the local docker daemon, pull the images and see if a newer version of them exist
- If it does, trigger a CI (Continuous integration) job to start a new container on top of the new image
How to use this?
Get the latest
version (or clone the repository if you feel adventurous), rename
config.cfg.dist
to config.cfg
and fill in the right
parameters. Then install the required Python packages found in
requirements.txt using pyenv:
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
Then you can run the script with python upgrade-drone.py
to upgrade images for
all projects, or use the --repo
command line flag to specify a git repository.
Languages
Python
100%