From dcb8a5451dfd13308796afc29fb30d7910dc6731 Mon Sep 17 00:00:00 2001 From: yrzr Date: Thu, 10 Dec 2020 13:56:22 +0800 Subject: [PATCH] add latest-tag.sh --- latest-tag.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 latest-tag.sh diff --git a/latest-tag.sh b/latest-tag.sh new file mode 100755 index 0000000..bda1c5d --- /dev/null +++ b/latest-tag.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +LATEST=$(git tag | sort -rV | head -n 1) + +if [ "${LATEST}" == "${CI_COMMIT_TAG}" ]; then + docker tag ${DOCKER_NS}/${BASENAME}:${CI_COMMIT_TAG} ${DOCKER_NS}/${BASENAME}:latest; +fi