CI / docker: make docker tagging a bit more thorough
Currently any commits (whatever the branch) overrides the latest docker tag. This can very very confusing !!
So we propose to
-
Tag based on branch name and keep the information of the corresponding commit id (use docker labels) This should be triggered on every push.
-
Change the .gitlab-ci.yml to named the docker image after the branch name: ...tansiv-ops-$branch:latest
-
-
On tag, rebuild (if necessary) the docker image to make it persistent.
-
On tag, build the doker image and name it after the tag name: ...tansiv-ops:$tag
-
Optimize by checking if an image is already built on any branch where the current is ( maybe use git branch --contains
for finding the branches)
-