Skip to content

Commit 736a81c

Browse files
committed
Merge pull request #15 from joyent/test-build
Added script for running test builds of all images
2 parents 762a8f1 + f29260b commit 736a81c

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test-build.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Run a test build for all images.
4+
5+
set -uo pipefail
6+
IFS=$'\n\t'
7+
8+
DOCKERFILES=$(find . -name Dockerfile)
9+
10+
info() {
11+
printf "%s\n" "$@"
12+
}
13+
14+
fatal() {
15+
printf "**********\n"
16+
printf "%s\n" "$@"
17+
printf "**********\n"
18+
exit 1
19+
}
20+
21+
for DOCKERFILE in $DOCKERFILES ; do
22+
TAG=$(echo $DOCKERFILE | sed 's/Dockerfile//g')
23+
info "=========="
24+
info "Building $TAG..."
25+
docker build -q $TAG
26+
if [[ $? -gt 0 ]]; then
27+
fatal "Build of $TAG failed!"
28+
else
29+
info "Build of $TAG succeeded"
30+
fi
31+
done
32+
33+
info "All builds successful!"
34+
info "Dockerfiles:"
35+
info "$DOCKERFILES"
36+
37+
exit 0

0 commit comments

Comments
 (0)