File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed
Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -20,40 +20,54 @@ cd $(cd ${0%/*} && pwd -P);
2020
2121versions=( " $@ " )
2222if [ ${# versions[@]} -eq 0 ]; then
23- versions=( * / )
23+ versions=( * / )
2424fi
2525versions=( " ${versions[@]%/ } " )
2626
2727for version in " ${versions[@]} " ; do
2828 if [[ " $version " == " docs" ]]; then
2929 continue
3030 fi
31-
31+
3232 tag=$( cat $version /Dockerfile | grep " ENV NODE_VERSION" | cut -d' ' -f3)
33-
33+
3434 info " Building $tag ..."
3535 docker build -q -t node:$tag $version
36-
36+
3737 if [[ $? -gt 0 ]]; then
3838 fatal " Build of $tag failed!"
3939 else
4040 info " Build of $tag succeeded."
4141 fi
42-
42+
43+ OUTPUT=$( docker run --rm -it node:$tag node -e " process.stdout.write(process.versions.node)" )
44+ if [ " $OUTPUT " != " $tag " ]; then
45+ fatal " Test of $tag failed!"
46+ else
47+ info " Test of $tag succeeded."
48+ fi
49+
4350 variants=( onbuild slim wheezy )
44-
51+
4552 for variant in " ${variants[@]} " ; do
4653 info " Building $tag -$variant variant..."
4754 docker build -q -t node:$tag -$variant $version /$variant
48-
55+
4956 if [[ $? -gt 0 ]]; then
5057 fatal " Build of $tag -$variant failed!"
5158 else
5259 info " Build of $tag -$variant succeeded."
5360 fi
54-
61+
62+ OUTPUT=$( docker run --rm -it node:$tag -$variant node -e " process.stdout.write(process.versions.node)" )
63+ if [ " $OUTPUT " != " $tag " ]; then
64+ fatal " Test of $tag -$variant failed!"
65+ else
66+ info " Test of $tag -$variant succeeded."
67+ fi
68+
5569 done
56-
70+
5771done
5872
5973info " All builds successful!"
You can’t perform that action at this time.
0 commit comments