taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

debian-trixie-common (1274B)


      1 #!/bin/bash
      2 
      3 set -eu
      4 
      5 apt-get update
      6 apt-get -y upgrade
      7 # We need libtalerexchange-dev for taler-fakebank-run
      8 apt-get -y install taler-exchange libeufin-bank libeufin-nexus taler-merchant donau taler-harness taler-wallet-cli libtalerexchange-dev
      9 
     10 PG_DATA=$(mktemp -d)
     11 SOCKET_DIR="/var/run/postgresql" # Standard on Debian/Ubuntu/RHEL
     12 PGBIN=/usr/lib/postgresql/17/bin
     13 
     14 export PATH=$PGBIN:$PATH
     15 
     16 chown postgres:postgres "$PG_DATA"
     17 if [ ! -d "$SOCKET_DIR" ]; then
     18     mkdir -p "$SOCKET_DIR"
     19 fi
     20 chown postgres:postgres "$SOCKET_DIR"
     21 chmod 775 "$SOCKET_DIR"
     22 
     23 echo "Initializing database..."
     24 su - postgres -c "$PGBIN/initdb -D '$PG_DATA' --auth=trust --no-locale --encoding=UTF8" > /dev/null
     25 
     26 echo "Starting postgres..."
     27 # We DO NOT pass -k. We let it use the system compiled default.
     28 # We DO pass -c listen_addresses='' to disable TCP.
     29 su - postgres -c "$PGBIN/pg_ctl -D '$PG_DATA' -l '$PG_DATA/logfile' -o '-c listen_addresses=\"\"' start"
     30 
     31 echo "Waiting for postgres to be ready..."
     32 # We run pg_isready as postgres to avoid permission issues reading the socket initially
     33 until su - postgres -c "$PGBIN/pg_isready -q"; do
     34   sleep 0.5
     35 done
     36 
     37 su - postgres -c "$PGBIN/createdb testdb"
     38 
     39 su - postgres -c "$PGBIN/createuser -s root"
     40 
     41 bash
     42 
     43 taler-harness run-integrationtests --quiet