build_all.sh 617 Bytes
Newer Older
Daniele Venzano's avatar
Daniele Venzano committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#!/usr/bin/env bash

set -e

if [ ! -d docker ]; then
  exit
fi

REPOSITORY=${REPOSITORY:-zapps}
DOCKER_REGISTRY=${DOCKER_REGISTRY:-docker-registry:5000}

VERSION=${VERSION:-`date +%Y%m%d%H%M%S`}

built_images=''
for d in `find docker -mindepth 1 -maxdepth 1 -type d -printf '%f '`; do
  pushd docker/${d}
  docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/${d}:${VERSION} .
  docker push ${DOCKER_REGISTRY}/${REPOSITORY}/${d}:${VERSION}
  popd
  built_images+="${DOCKER_REGISTRY}/${REPOSITORY}/${d}:${VERSION}\n"
done

echo "-------------END SCRIPT-----------------"
echo "Images built:"
printf ${built_images}
echo