New attempt at making the build hooks to work

master
mlan 2019-02-08 17:00:24 +01:00
parent 1624ec0c9b
commit 842ba9a516
2 changed files with 11 additions and 5 deletions

View File

@ -1,7 +1,11 @@
#!/bin/bash
# hooks/build
# $DOCKER_REPO var is injected into the build environment
# $DOCKER_REPO and $CACHE_TAG are injected into the build environment
docker build --target kopano-core -t ${DOCKER_REPO}:latest-core .
docker build --target kopano-full -t ${DOCKER_REPO}:latest .
docker build --target kopano-debugtools -t ${DOCKER_REPO}:latest-debugtools .
case $CACHE_TAG in
latest-core) bld_target=kopano-core ;;
latest) bld_target=kopano-full ;;
latest-debugtools) bld_target=kopano-debugtools ;;
esac
docker build --target $bld_target -t ${DOCKER_REPO}:${CACHE_TAG} .

View File

@ -9,10 +9,12 @@ _docker_add_tags() {
docker push $DOCKER_REPO:$tag
}
if [ "$CACHE_TAG" == "latest" ]; then
if [[ "$CACHE_TAG" == "latest" ]]; 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}
fi