zammad-docker-compose/hooks/build

32 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#
# build hook for dockerhubs autobuild feature
#
set -ex
. "hooks/config"
for DOCKER_IMAGE in ${DOCKER_IMAGES}; do
2017-09-12 05:42:14 +00:00
if [ "${TRAVIS}" == 'true' ]; then
if [ -n "${ZAMMAD_VERSION}" ]; then
DOCKER_TAG="-t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}"
fi
echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${ZAMMAD_VERSION} for DockerHubs ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE} repo"
docker build --pull --no-cache --build-arg BUILD_DATE=$(date -u +”%Y-%m-%dT%H:%M:%SZ”) -t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE} ${DOCKER_TAG} -f containers/${DOCKER_IMAGE}/Dockerfile .
2017-07-23 15:18:50 +00:00
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}
else
echo "Build Zammad Docker image ${DOCKER_IMAGE} for DockerHubs ${DOCKER_REPO}:${DOCKER_IMAGE} repo"
2017-01-12 16:09:55 +00:00
docker build --pull --no-cache --build-arg BUILD_DATE=$(date -u +”%Y-%m-%dT%H:%M:%SZ”) -t ${DOCKER_REPO}:${DOCKER_IMAGE} -f containers/${DOCKER_IMAGE}/Dockerfile .
docker push ${DOCKER_REPO}:${DOCKER_IMAGE}
fi
done