Skip to content

Do not override Docker latest tag for backports

The following discussion from !36 (merged) should be addressed:

  • @vshushlin started a discussion: (+1 comment)

    Question: what happens if you cut tag for somekine of backport.

    E.g. the current latest version is 2.1.0 and you push 2.0.15 tag.

    Will it override latest image in registry?

  • !36 (comment 372135313)

Proposal

git version >= 2.0 allows us to use --sort so we can do something like

script:
  - latestGitTag=$(git tag -l --sort=-v:refname | head -1)
  - if $CI_COMMIT_TAG == latestGitTag; then proceed
Edited by Jackie Porter