diff --git a/hooks/build b/hooks/build index a2f1e7d..2a2723f 100644 --- a/hooks/build +++ b/hooks/build @@ -1,19 +1,20 @@ #!/bin/bash # hooks/build -# $DOCKER_REPO and $CACHE_TAG are injected into the build environment +# $DOCKER_REPO and $DOCKER_TAG are injected into the build environment -echo "hooks/build called with IMAGE_NAME=${DOCKER_REPO}:${CACHE_TAG}, so we will run:" +echo "hooks/build called with IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG}, so we will run:" +printenv -case "${CACHE_TAG}" in +case "${DOCKER_TAG}" in core) bld_target=kopano-core ;; full) bld_target=kopano-full ;; debugtools) bld_target=kopano-debugtools ;; webapp) bld_target=kopano-webapp ;; *) - echo "NOTHING since we do not know how to build with tag=${CACHE_TAG}" + echo "NOTHING since we do not know how to build with tag=${DOCKER_TAG}" exit 1 ;; esac -echo "docker build --target $bld_target -t ${DOCKER_REPO}:${CACHE_TAG} ." -docker build --target $bld_target -t ${DOCKER_REPO}:${CACHE_TAG} . +echo "docker build --target $bld_target -t ${DOCKER_REPO}:${DOCKER_TAG} ." +docker build --target $bld_target -t ${DOCKER_REPO}:${DOCKER_TAG} . diff --git a/hooks/post_push b/hooks/post_push index 4bcc5fb..cbdb6be 100644 --- a/hooks/post_push +++ b/hooks/post_push @@ -5,17 +5,17 @@ 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 use tag=$tag" + echo "hooks/post_push called with IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG}, so we will use tag=$tag" docker tag $IMAGE_NAME $DOCKER_REPO:$tag docker push $DOCKER_REPO:$tag } -if [[ "$CACHE_TAG" == "full" ]]; then +if [[ "$DOCKER_TAG" == "full" ]]; then _docker_add_tags latest _docker_add_tags latest-full _docker_add_tags ${version} _docker_add_tags ${version}-full else - _docker_add_tags latest-${CACHE_TAG} - _docker_add_tags ${version}-${CACHE_TAG} + _docker_add_tags latest-${DOCKER_TAG} + _docker_add_tags ${version}-${DOCKER_TAG} fi