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);
20
20
21
21
versions=( " $@ " )
22
22
if [ ${# versions[@]} -eq 0 ]; then
23
- versions=( * / )
23
+ versions=( * / )
24
24
fi
25
25
versions=( " ${versions[@]%/ } " )
26
26
27
27
for version in " ${versions[@]} " ; do
28
28
if [[ " $version " == " docs" ]]; then
29
29
continue
30
30
fi
31
-
31
+
32
32
tag=$( cat $version /Dockerfile | grep " ENV NODE_VERSION" | cut -d' ' -f3)
33
-
33
+
34
34
info " Building $tag ..."
35
35
docker build -q -t node:$tag $version
36
-
36
+
37
37
if [[ $? -gt 0 ]]; then
38
38
fatal " Build of $tag failed!"
39
39
else
40
40
info " Build of $tag succeeded."
41
41
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
+
43
50
variants=( onbuild slim wheezy )
44
-
51
+
45
52
for variant in " ${variants[@]} " ; do
46
53
info " Building $tag -$variant variant..."
47
54
docker build -q -t node:$tag -$variant $version /$variant
48
-
55
+
49
56
if [[ $? -gt 0 ]]; then
50
57
fatal " Build of $tag -$variant failed!"
51
58
else
52
59
info " Build of $tag -$variant succeeded."
53
60
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
+
55
69
done
56
-
70
+
57
71
done
58
72
59
73
info " All builds successful!"
You can’t perform that action at this time.
0 commit comments