fix: run_local_server script (#21)
This commit is contained in:
parent
d4577f5e61
commit
186ce6c5af
|
|
@ -4,7 +4,18 @@ set -eo pipefail
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
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
|
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 database create
|
||||||
sqlx migrate run
|
sqlx migrate run
|
||||||
cargo run
|
cargo run
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue