#!/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. apt install -y postgresql-$PGVERSION # 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 # PGVERSION needs to be defined in the containerfile /usr/bin/pg_ctlcluster $PGVERSION main start apt update # I don't want gdebi or any other monster), so I do a local DaCHS installation # and then apt install -f for the dependencies dpkg -i /dachs-pkg/*.deb # this is still going to fail because no postgres is running, but it will # pull DaCHS' dependencies. apt-get -y install -f /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 # postgres should be up by now; create a root role for easy inspection # when something goes wrong. su - postgres -c "createuser -s root" # now the DaCHS installation should finally pass. apt-get -y install -f # I've not found the podman option to do that (or something better) from there: chmod -R 777 /var/gavo-inputs # we install the server # 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