Environments: docker-image-tags created through feature-branches are automatically removed

This MR relates to issue #10.

It introduces dynamic environments (see https://docs.gitlab.com/ee/ci/yaml/#dynamic-environments). Each environment is now associated with a stop-job. The job can be manually executed and will delete the tag from docker hub. The job is also automatically executed when the feature branch is deleted either directly or through an accepted MR. The master branch also defines an environment but no stop-jobs to delete these images are specified. The environments offer to redeploy the image by executing the job of the last pipeline again.

A python script to access the docker hub API lies in ./ci-utils/docker.py and provides two functions:

  • del_tag
  • del_tags

The first function is used by the CI to automatically delete tags generated by feature branches. The second function can be used in conjunction with with a line-by-line stdin to delete multiple tags. This is documented in the readme.

Remaining issue:

  • GIT_STRATEGY: none has to be defined by a variable
Edited by Gabriel Le Breton

Merge request reports

Loading