forked from jakolehm/docker-galera-mariadb-10.0
-
Notifications
You must be signed in to change notification settings - Fork 103
/
test.sh
executable file
·38 lines (35 loc) · 1.15 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
37
38
#!/bin/bash
set -e
IMAGE=${1?"Usage: $0 IMAGE_NAME"}
if [[ $IMAGE != "--cleanup" ]]; then
docker network create cm-galera-test
docker run -d --name cm-galera-test-seed --network cm-galera-test --network-alias seed \
-e XTRABACKUP_PASSWORD=foobar \
-e SKIP_TZINFO=1 \
$IMAGE seed --log-bin=mysqld-bin
sleep 5
docker logs cm-galera-test-seed
docker run -d --name cm-galera-test-node1 --network cm-galera-test \
-e XTRABACKUP_PASSWORD=foobar \
-e SKIP_TZINFO=1 \
-e GCOMM_MINIMUM=1 \
$IMAGE node seed --log-bin=mysqld-bin
sleep 5
docker logs cm-galera-test-node1
docker run --name cm-galera-test-node2 --network cm-galera-test \
-e XTRABACKUP_PASSWORD=foobar \
-e SKIP_TZINFO=1 \
-e GCOMM_MINIMUM=1 \
$IMAGE node seed,node1 --log-bin=mysqld-bin
fi
if [[ -z $SKIP_CLEANUP ]]; then
echo "Cleaning up..."
set +e
docker stop cm-galera-test-seed
docker rm -v cm-galera-test-seed
docker stop cm-galera-test-node1
docker rm -v cm-galera-test-node1
docker stop cm-galera-test-node2
docker rm -v cm-galera-test-node2
docker network rm cm-galera-test
fi