Another try to get docker hub build hooks to work

master
mlan 2019-02-09 08:41:38 +01:00
parent 8e1d79f2b5
commit 3f1f8c1987
2 changed files with 8 additions and 8 deletions

View File

@ -5,10 +5,10 @@
echo "hooks/build called with IMAGE_NAME=${DOCKER_REPO}:${CACHE_TAG}, so we will run:"
case "${CACHE_TAG}" in
"latest-core") bld_target=kopano-core ;;
"latest"|"latest-full") bld_target=kopano-full ;;
"latest-debugtools") bld_target=kopano-debugtools ;;
"latest-webapp") bld_target=kopano-webapp ;;
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}"
exit 1

View File

@ -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 tag=$tag"
echo "hooks/post_push called with IMAGE_NAME=${DOCKER_REPO}:${CACHE_TAG}, so we will use tag=$tag"
docker tag $IMAGE_NAME $DOCKER_REPO:$tag
docker push $DOCKER_REPO:$tag
}
if [[ "$CACHE_TAG" == "latest" ]]; then
if [[ "$CACHE_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 ${CACHE_TAG}
_docker_add_tags ${version}${CACHE_TAG#latest}
_docker_add_tags latest-${CACHE_TAG}
_docker_add_tags ${version}-${CACHE_TAG}
fi