Files
omnivore/self-hosting/selfhost.sh
2023-05-09 15:40:40 +08:00

17 lines
496 B
Bash

#!/bin/sh
echo "creating omnivore database with $(which psql)"
psql --host $PG_HOST -U $PG_USER -c "CREATE DATABASE omnivore;"
echo "creating app_user"
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "CREATE USER app_user WITH PASSWORD 'app_pass';"
echo "created app_user"
echo "running migrations"
yarn workspace @omnivore/db migrate
psql --host $PG_HOST -U $PG_USER -d $PG_DB -c "GRANT omnivore_user TO app_user;"
echo "granted omnivore_user to app_user"
yarn workspace @omnivore/api start