From c7f207c903a948c9df22996fdaaf8c0fe907fc24 Mon Sep 17 00:00:00 2001 From: mlan Date: Fri, 8 Feb 2019 18:12:29 +0100 Subject: [PATCH] Yet another attempt at making the build hooks to work --- hooks/build | 10 ++++++---- hooks/post_push | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hooks/build b/hooks/build index 74a6a47..03dc59f 100644 --- a/hooks/build +++ b/hooks/build @@ -2,10 +2,12 @@ # hooks/build # $DOCKER_REPO and $CACHE_TAG are injected into the build environment -case $CACHE_TAG in - latest-core) bld_target=kopano-core ;; - latest) bld_target=kopano-full ;; - latest-debugtools) bld_target=kopano-debugtools ;; +case "${CACHE_TAG}" in + "latest-core") bld_target=kopano-core ;; + "latest") bld_target=kopano-full ;; + "latest-debugtools") bld_target=kopano-debugtools ;; esac +echo "hooks/build called with IMAGE_NAME=${DOCKER_REPO}:${CACHE_TAG}, so we will run:" +echo "docker build --target $bld_target -t ${DOCKER_REPO}:${CACHE_TAG} ." docker build --target $bld_target -t ${DOCKER_REPO}:${CACHE_TAG} . diff --git a/hooks/post_push b/hooks/post_push index aa65159..9be26cf 100644 --- a/hooks/post_push +++ b/hooks/post_push @@ -5,6 +5,7 @@ version=$(assets/kopano-webaddr.sh -VV) _docker_add_tags() { local tag="$1" + echo "hooks/post_push called with IMAGE_NAME=${DOCKER_REPO}:${CACHE_TAG}, so we will tag=$tag" docker tag $IMAGE_NAME $DOCKER_REPO:$tag docker push $DOCKER_REPO:$tag }