|
@@ -13,11 +13,17 @@ fi
|
|
|
if ! [ -x "$(command -v sqlx)" ]; then
|
|
|
echo >&2 "Error: `sqlx` is not installed."
|
|
|
echo >&2 "Use:"
|
|
|
- echo >&2 " cargo install --version=^0.5.6 sqlx-cli --no-default-features --features postgres"
|
|
|
+ echo >&2 " cargo install --version=^0.5.7 sqlx-cli --no-default-features --features postgres"
|
|
|
echo >&2 "to install it."
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
+DB_USER="${POSTGRES_USER:=postgres}"
|
|
|
+DB_PASSWORD="${POSTGRES_PASSWORD:=password}"
|
|
|
+DB_PORT="${POSTGRES_PORT:=5433}"
|
|
|
+DB_HOST="${POSTGRES_HOST:=localhost}"
|
|
|
+DB_NAME="${POSTGRES_DB:=flowy}"
|
|
|
+
|
|
|
if [[ -z "${SKIP_DOCKER}" ]]
|
|
|
then
|
|
|
RUNNING_POSTGRES_CONTAINER=$(docker ps --filter 'name=postgres' --format '{{.ID}}')
|
|
@@ -28,12 +34,12 @@ then
|
|
|
fi
|
|
|
|
|
|
docker run \
|
|
|
- --name="flowy" \
|
|
|
-e POSTGRES_USER=${DB_USER} \
|
|
|
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
|
|
|
- -e POSTGRES_DB=${DB_NAME} \
|
|
|
+ -e POSTGRES_DB="${DB_NAME}" \
|
|
|
-p "${DB_PORT}":5432 \
|
|
|
-d postgres \
|
|
|
+ --name "postgres_$(date '+%s')" \
|
|
|
postgres -N 1000
|
|
|
fi
|
|
|
|