-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildTestAndPush
More file actions
executable file
·53 lines (42 loc) · 1.45 KB
/
buildTestAndPush
File metadata and controls
executable file
·53 lines (42 loc) · 1.45 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/bash
set -e
echo "
------------------------------------------------------------------------
------------------------------------------------------------------------
------------- Building ---------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
"
composeFile=docker/docker-compose.yml
docker-compose -f $composeFile build
listImages=($(sed -nr 's/image: *(.+)/\1/p' $composeFile))
testFail=0
echo "
------------------------------------------------------------------------
------------------------------------------------------------------------
------------- Test running ---------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
"
IFS=""
for imageTag in ${listImages[@]}
do
if [[ ! "${imageTag}" =~ .*-dev.* ]] ; then
echo "ignore image ${imageTag}"
continue
fi
testCommand=testDeps
if [[ "${imageTag}" =~ .*php:5\.6.* ]] ; then
testCommand=testDeps56
fi
if docker run --rm --entrypoint="${testCommand}" "$imageTag" > /dev/null ; then
echo "TEST PASS: '${imageTag}'"
else
testFail=1
echo "TEST FAIL: '${imageTag}'"
fi
done
if [[ "$testFail" == "1" ]]; then
exit 1
fi
docker-compose -f $composeFile push