#!/bin/bash # The init of docker image; this essentially starts postgres and installs # DaCHS and the packages maintained by us. # # Yes, this is running postgres and DaCHS in one container. This is about # integration testing, not deployment, so best practices go to hell. export PGVERSION=${PGVERSION-13} # no idea why Debian sometimes configures postgres' port to 5433. # There's no other cluster here. Anyway, I'll hack this sed -ie 's/port = 5433/port = 5432/' /etc/postgresql/$PGVERSION/main/postgresql.conf /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 update # postgres should be up by now; create a root role for easy inspection # when something goes wrong. su - postgres -c "createuser -s root" # I've not found the podman option to do that (or something better) from there: chmod -R 777 /var/gavo-inputs # now install the server; no idea why the solver does not find the # gavo-votable thing itself at this point and zero time to investigate. apt-get install -y python3-gavo-votable/$DACHS_SUITE gavodachs2-server/$DACHS_SUITE # and stop it, as we want it running as dachsroot later dachs serve stop # prepare the test script cd /home/dachsroot # and run the test script su dachsroot -c "sh /dachstest.sh" # give control to the user so they can inspect if something went wrong. exec bash