an implementation of the polyproto federation protocol
1#!/usr/bin/env bash
2
3# SPDX-FileCopyrightText: 2025 Ruby Iris Juric <ruby@srxl.me>
4#
5# SPDX-License-Identifier: AGPL-3.0-or-later
6
7root=$(git rev-parse --show-toplevel)
8
9export PGDATA=$root/.pgdata-local
10
11if [ ! -d "$PGDATA" ]; then
12 echo "No local postgres db found, setting up in $PGDATA"
13 initdb
14 pg_ctl -o "-c unix_socket_directories=$PGDATA" start
15 createuser -h "$PGDATA" -d resonance
16 mix ecto.create
17 mix ecto.migrate
18 mix test.setup
19 pg_ctl stop
20fi
21
22postgres -c unix_socket_directories="$PGDATA"