unpoller_unpoller/init/docker/hooks/build

32 lines
947 B
Bash
Executable File

#!/bin/bash
# This always run local to the Dockerfile folder, so the path is ../..
set -e -o pipefail
# The Docker Cloud config must pass in the BUILDS env variable.
# See README.md (in this dir) and the screenshot for more info.
source ../../.metadata.sh
# Build each configured image from Docker Cloud.
for build in $BUILDS; do
# os:name:arch:variant
os=$(echo $build | cut -d: -f1)
name=$(echo $build | cut -d: -f2)
echo "Building Image ${IMAGE_NAME}_${os}_${name}"
docker build \
--build-arg "ARCH=${name}" \
--build-arg "BUILD_DATE=${DATE}" \
--build-arg "COMMIT=${COMMIT}" \
--build-arg "VERSION=${VERSION}-${ITERATION}" \
--build-arg "LICENSE=${LICENSE}" \
--build-arg "TITLE=${TITLE}" \
--build-arg "DESC=${DESC}" \
--build-arg "URL=${URL}" \
--build-arg "VENDOR=${VENDOR}" \
--build-arg "AUTHOR=${AUTHOR}" \
--tag "${IMAGE_NAME}_${os}_${name}" \
--file Dockerfile ../..
done