This repository contains docker and docker-compose files to simulate the infrastructure required by gnuviechadmin components.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

startup.sh 680B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. set -e
  3. /usr/bin/pg_ctlcluster 11 main start
  4. echo -n "Waiting for database to become ready ."
  5. while ! pg_isready -q; do sleep 1; echo -n "."; done
  6. echo " done"
  7. if su - -c "psql -l" postgres | grep -q gnuviechadmin; then
  8. echo database gnuviechadmin exists
  9. else
  10. su - -c "psql -e" postgres <<EOF
  11. CREATE USER gnuviechadmin CREATEDB LOGIN PASSWORD '${GVA_PGSQL_PASSWORD}';
  12. CREATE DATABASE gnuviechadmin TEMPLATE template0 ENCODING utf8 LC_COLLATE 'C.UTF-8' LC_CTYPE 'C.UTF-8';
  13. GRANT CREATE, CONNECT ON DATABASE gnuviechadmin TO gnuviechadmin;
  14. EOF
  15. fi
  16. /usr/bin/pg_ctlcluster 11 main stop --foreground
  17. /usr/bin/pg_ctlcluster 11 main start --foreground -o '-h 0.0.0.0'