Yet another attempt at making the build hooks to work

master
mlan 2019-02-08 18:12:29 +01:00
parent 842ba9a516
commit c7f207c903
2 changed files with 7 additions and 4 deletions

View File

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

View File

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