Added script for running test builds of all images

This commit is contained in:
Christopher Horrell 2015-05-04 15:38:40 -04:00
parent 762a8f163f
commit f29260b2f5
1 changed files with 37 additions and 0 deletions

37
test-build.sh Executable file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env bash
#
# Run a test build for all images.
set -uo pipefail
IFS=$'\n\t'
DOCKERFILES=$(find . -name Dockerfile)
info() {
printf "%s\n" "$@"
}
fatal() {
printf "**********\n"
printf "%s\n" "$@"
printf "**********\n"
exit 1
}
for DOCKERFILE in $DOCKERFILES ; do
TAG=$(echo $DOCKERFILE | sed 's/Dockerfile//g')
info "=========="
info "Building $TAG..."
docker build -q $TAG
if [[ $? -gt 0 ]]; then
fatal "Build of $TAG failed!"
else
info "Build of $TAG succeeded"
fi
done
info "All builds successful!"
info "Dockerfiles:"
info "$DOCKERFILES"
exit 0