File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ puts-error() {
1010 echo " !!! $@ "
1111}
1212
13+ kill-containers () {
14+ puts-step " destroying containers"
15+ docker rm -f " $MINIO_JOB " " $PG_JOB "
16+ }
17+
1318# make sure we are in this dir
1419CURRENT_DIR=$( cd $( dirname $0 ) ; pwd)
1520
@@ -51,6 +56,9 @@ MINIO_JOB=$(docker run -dv $CURRENT_DIR/tmp/aws-admin:/var/run/secrets/deis/mini
5156# boot postgres, linking the minio container and setting DEIS_MINIO_SERVICE_HOST and DEIS_MINIO_SERVICE_PORT
5257PG_JOB=$( docker run -d --link $MINIO_JOB :minio -e BACKUP_FREQUENCY=1s -e DATABASE_STORAGE=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:/var/run/secrets/deis/objectstore/creds $1 )
5358
59+ # kill containers when this script exits or errors out
60+ trap kill-containers INT TERM
61+
5462# wait for postgres to boot
5563puts-step " sleeping for 90s while postgres is booting..."
5664sleep 90s
@@ -72,8 +80,3 @@ if [[ ! "$NUM_BACKUPS" -eq "5" ]]; then
7280 puts-error " did not find 5 base backups, which is the default (found $NUM_BACKUPS )"
7381 exit 1
7482fi
75-
76- # success, kill off jobs
77- puts-step " destroying containers"
78- docker rm -f $MINIO_JOB
79- docker rm -f $PG_JOB
You can’t perform that action at this time.
0 commit comments