-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-all
executable file
·60 lines (56 loc) · 1.54 KB
/
build-all
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
54
55
56
57
58
59
60
#!/bin/bash
set -e
LIST=${LIST:-pg base portal uwsgi-portal manager full ssoaas-fastcgi-server cron cron-task sessions-backup}
#LIST=${LIST:-pg base portal uwsgi-portal manager full ssoaas-fastcgi-server cron dev}
if test "$(cd base && md5sum *.patch|sort)" != "$(cd base-no-s6 && md5sum *.patch|sort)"; then
echo "Base patches differ" >&2
exit 1
fi
if test "$(cd portal && md5sum *.patch|sort)" != "$(cd uwsgi-portal && md5sum *.patch|sort)"; then
echo "Portal patches differ" >&2
exit 1
fi
if test "$(cd manager && md5sum *.patch|sort)" != "$(cd full && md5sum *.patch|sort)"; then
echo "Manager patches differ" >&2
exit 1
fi
if test "`md5sum uwsgi-portal/install/etc/cont-init.d/update-nginx-portal-conf|sed -e 's/ .*$//'`" != "`md5sum portal/install/etc/cont-init.d/update-nginx-portal-conf|sed -e 's/ .*$//'`"; then
echo "Portal install differ" >&2
exit 1
fi
for i in $LIST; do
(
cd $i
if test "$i" = "dev"; then
./build-dev
else
NAME=`grep 'name="yadd/' Dockerfile|sed -e 's/.*name="//' -e 's/".*$//'`
docker build --rm -t $NAME --build-arg="BASE=yadd/lemonldap-ng-base:latest" --build-arg "PORTALBASE=yadd/lemonldap-ng-portal:latest" .
if test "$IMAGE_EXPORT" = "yes"; then
docker save $NAME > /tmp/$i.tar
fi
if test "$PUBLISH" = "yes"; then
docker push $NAME
fi
fi
if test "$i" != "full"; then
if test -x test; then
./test
fi
fi
)
done
for i in $LIST; do
(
cd $i
if test -x clean; then
./clean || true
fi
)
done
if test "$IMAGE_EXPORT" = "yes"; then
(
cd /tmp
tar czf images.tar.gz ${LIST// /.tar }.tar
)
fi