Skip to content

Commit

Permalink
fix: run_local_server script (AppFlowy-IO#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy authored Sep 8, 2023
1 parent d4577f5 commit 186ce6c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build/run_local_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ set -eo pipefail

cd "$(dirname "$0")/.."

DB_USER="${POSTGRES_USER:=postgres}"
DB_PASSWORD="${POSTGRES_PASSWORD:=password}"
DB_PORT="${POSTGRES_PORT:=5433}"
DB_HOST="${POSTGRES_HOST:=localhost}"

docker-compose --file ./docker-compose-dev.yml up -d --build

# Keep pinging Postgres until it's ready to accept commands
until PGPASSWORD="${DB_PASSWORD}" psql -h "${DB_HOST}" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c '\q'; do
>&2 echo "Postgres is still unavailable - sleeping"
sleep 1
done
sqlx database create
sqlx migrate run
cargo run

0 comments on commit 186ce6c

Please sign in to comment.