@@ -6,6 +6,10 @@ puts-step() {
66 echo " -----> $@ "
77}
88
9+ puts-error () {
10+ echo " !!! $@ "
11+ }
12+
913# make sure we are in this dir
1014CURRENT_DIR=$( cd $( dirname $0 ) ; pwd)
1115
@@ -43,11 +47,11 @@ echo "cert" > $CURRENT_DIR/tmp/k8s/ca.crt
4347MINIO_JOB=$( docker run -dv $CURRENT_DIR /tmp/aws-admin:/var/run/secrets/deis/minio/admin -v $CURRENT_DIR /tmp/aws-user:/var/run/secrets/deis/minio/user -v $CURRENT_DIR /tmp/k8s:/var/run/secrets/kubernetes.io/serviceaccount quay.io/deisci/minio:v2-beta boot server /home/minio/)
4448
4549# boot postgres, linking the minio container and setting DEIS_MINIO_SERVICE_HOST and DEIS_MINIO_SERVICE_PORT
46- PG_JOB=$( docker run -d --link $MINIO_JOB :minio -e DEIS_MINIO_SERVICE_HOST=minio -e DEIS_MINIO_SERVICE_PORT=9000 -v $CURRENT_DIR /tmp/creds:/var/run/secrets/deis/database/creds -v $CURRENT_DIR /tmp/aws-user:/etc/wal-e.d/env $1 )
50+ PG_JOB=$( docker run -d --link $MINIO_JOB :minio -e BACKUP_FREQUENCY=1s -e DEIS_MINIO_SERVICE_HOST=minio -e DEIS_MINIO_SERVICE_PORT=9000 -v $CURRENT_DIR /tmp/creds:/var/run/secrets/deis/database/creds -v $CURRENT_DIR /tmp/aws-user:/etc/wal-e.d/env $1 )
4751
4852# wait for postgres to boot
49- puts-step " sleeping for 1 minute while postgres is booting..."
50- sleep 1m
53+ puts-step " sleeping for 90s while postgres is booting..."
54+ sleep 90s
5155
5256# display logs for debugging purposes
5357puts-step " displaying minio logs"
@@ -59,6 +63,14 @@ docker logs $PG_JOB
5963puts-step " checking if database is running"
6064docker exec $PG_JOB is_running
6165
66+ # check if minio has the 5 backups
67+ puts-step " checking if minio has 5 backups"
68+ NUM_BACKUPS=" $( docker exec $MINIO_JOB ls /home/minio/dbwal/basebackups_005/ | grep json | wc -l) "
69+ if [[ ! " $NUM_BACKUPS " -eq " 5" ]]; then
70+ puts-error " did not find 5 base backups, which is the default (found $NUM_BACKUPS )"
71+ exit 1
72+ fi
73+
6274# success, kill off jobs
6375puts-step " destroying containers"
6476docker rm -f $MINIO_JOB
0 commit comments