#!/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-get update apt-get install -y postgresql postgresql-client # no idea why Debian sometime 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 # get ready for using GAVO's repository echo "deb http://vo.ari.uni-heidelberg.de/debian release main" \ > /etc/apt/sources.list.d/gavo.list curl -o /etc/apt/trusted.gpg.d/gavo-archive.key.asc \ https://docs.g-vo.org/archive-key.asc apt-get update # postgres should be up by now; create a root user for easy inspection # when something goes wrong. su - postgres -c "createuser -s root" # now install the server apt-get install -y gavodachs2-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