#!/bin/bash # The init of docker image; this starts postgres, upgrades DaCHS, and # runs some regression tests. # # Yes, this is running postgres and DaCHS in one container. This is about # integration testing, not deployment, so best practices go to hell. /usr/bin/pg_ctlcluster $PGVERSION main start while ! /usr/bin/pg_ctlcluster $PGVERSION main status > /dev/null; do sleep 5; echo "Waiting for database to come up" done apt-get -y update DEBIAN_FRONTEND='noninteractive' apt-get -y dist-upgrade dachs serve start BUILDSTAMP=/var/tmp/resources-imported if [ -f $BUILDSTAMP ]; then dachs test -v ALL dachs test -vd //tests else sh /var/gavo-inputs/test-script touch $BUILDSTAMP fi # give control to the user so they can inspect if something went wrong. exec bash