#!/bin/bash # The init of docker image; this checks out and installs whatever is on # the main branch of DaCHS and runs tests. /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" addgroup gavo adduser --system --no-create-home --home /nonexistent --ingroup gavo gavo adduser --disabled-password --gecos "" --ingroup gavo dachsroot su postgres -c "createdb --encoding=UTF-8 --template template0 gavo" su postgres -c "createuser -s dachsroot" mkdir -p /var/gavo/ chown dachsroot /var/gavo/ cd /var/gavo git clone https://gitlab-p4n.aip.de/gavo/dachs.git dachs chown -R dachsroot:gavo dachs cd dachs python3 setup.py develop su dachsroot -c "dachs init" # I've not found the podman option to do that (or something better) from there: chmod -R 777 /var/gavo-inputs # 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