forked from maxking/docker-mailman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·36 lines (27 loc) · 1.17 KB
/
test.sh
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
#!/bin/bash
set -e
# If the DB environment variable is not set, use postgres.x
if [ "$DB" = "postgres" ] || [ -z $DB ]
then
docker-compose -f docker-compose.yaml -f docker-test.yaml up -d
elif [ "$DB" = "mysql" ]
then
docker-compose -f docker-compose-mysql.yaml -f docker-test.yaml up -d
fi
# Print the IP Addresses of the Containers.
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mailman-core
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mailman-web
# Make sure all the containers are running.
docker-compose ps
# Sleep for a while and check again if the containers are up.
sleep 60
docker ps
# Check if there is anything interesting in the logs.
docker logs mailman-web
docker logs mailman-core
# Check to see if the core is working as expected.
docker exec mailman-core curl -u restadmin:restpass http://172.19.199.2:8001/3.1/system | grep "GNU Mailman"
# Check to see if postorius is working.
docker exec mailman-web curl -L http://172.19.199.3:8000/postorius/lists | grep "Mailing List"
# Check to see if hyperkitty is working.
docker exec mailman-web curl -L http://172.19.199.3:8000/hyperkitty/ | grep "Available lists"