anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

3-startdb.sh (1364B)


      1 #!/bin/bash
      2 set -evux
      3 
      4 PG_BIN=$(pg_config --bindir)
      5 PG_ETC=$(pg_config --sharedir | sed 's|/usr/share/postgresql|/etc/postgresql|')
      6 export PGPORT=5432
      7 
      8 sudo -u postgres "${PG_BIN}/pg_ctl" \
      9   start \
     10   -D ${PG_ETC}/main \
     11   -o "-h localhost -p $PGPORT"
     12 sleep 10
     13 sudo -u postgres createuser -p "$PGPORT" root -s -w
     14 
     15 # 'anastasistalercheck' is used by the exchange, the merchant and
     16 # libeufin-bank that taler-unified-setup.sh brings up for the reducer and
     17 # IBAN tests.  taler-unified-setup.sh runs every one of those dbinits with
     18 # --reset, so the name must NOT be shared with another project's test
     19 # suite: the plain 'talercheck' that the exchange, merchant, sync and donau
     20 # suites all use gets its schema dropped out from under a running exchange
     21 # whenever two of those suites overlap on one host, which shows up here as
     22 # spurious 500s ('relation "denominations" does not exist') from
     23 # taler-exchange-offline.
     24 sudo -u postgres createdb -p "$PGPORT" -O root anastasistalercheck
     25 # The provider database: 'anastasischeck' for the stasis and testing
     26 # suites, 'anastasischeck1' .. 'anastasischeck4' for the four providers
     27 # the reducer/CLI tests run against (see src/cli/test_anastasis_reducer_*.conf).
     28 sudo -u postgres createdb -p "$PGPORT" -O root anastasischeck
     29 for n in 1 2 3 4; do
     30   sudo -u postgres createdb -p "$PGPORT" -O root "anastasischeck${n}"
     31 done