add latest-tag.sh

This commit is contained in:
yrzr 2020-12-10 13:56:22 +08:00
parent d50e88cb11
commit dcb8a5451d
1 changed files with 7 additions and 0 deletions

7
latest-tag.sh Executable file
View File

@ -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