From 23c9f0464fc75512fac60b0830157e627b58cddf Mon Sep 17 00:00:00 2001 From: selim13 Date: Tue, 13 Sep 2016 18:37:25 +0300 Subject: [PATCH] post_push multi tags test --- 3.1-apache/hooks/post_push | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 3.1-apache/hooks/post_push diff --git a/3.1-apache/hooks/post_push b/3.1-apache/hooks/post_push new file mode 100755 index 0000000..6a1fa88 --- /dev/null +++ b/3.1-apache/hooks/post_push @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Parse image name for repo name +tagStart=$(expr index "$IMAGE_NAME" :) +repoName=${IMAGE_NAME:0:tagStart-1} + +# Tag and push image for each additional tag +for tag in {3,3.1,3-apache,3.1-apache,apache,latest}; do + docker tag $IMAGE_NAME ${repoName}:${tag} + docker push ${repoName}:${tag} +done \ No newline at end of file