New attempt at making the build hooks to work
parent
1624ec0c9b
commit
842ba9a516
12
hooks/build
12
hooks/build
|
@ -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} .
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue