From: Thomas Bruederli Date: Wed, 24 Jul 2019 19:41:55 +0000 (+0200) Subject: Add post_build hook to tag latest X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=742d4eb3de00398ca0435775d2df9f6f070f4eed;p=roundcube-roundcubemail-docker.git Add post_build hook to tag latest --- diff --git a/hooks/post_build b/hooks/post_build new file mode 100755 index 0000000..23a078e --- /dev/null +++ b/hooks/post_build @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +tagStart=$(echo $IMAGE_NAME | awk '{print index($1,":")}') +repoName=${IMAGE_NAME:0:tagStart-1} +tagName=${IMAGE_NAME:tagStart:99} + +if [ "$tagName" = "latest-apache" ]; then + echo "Tagging $IMAGE_NAME as :latest" + + docker tag $IMAGE_NAME ${repoName}:latest + docker push ${repoName}:latest +fi