mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
update backend scripts
This commit is contained in:
parent
6504863586
commit
e1ed027b9c
@ -1,11 +1,10 @@
|
|||||||
.EXPORT_ALL_VARIABLES:
|
#.EXPORT_ALL_VARIABLES:
|
||||||
export DB_USER=postgres
|
#export DB_USER=postgres
|
||||||
export DB_PASSWORD=password
|
#export DB_PASSWORD=password
|
||||||
export DB_NAME=flowy
|
#export DB_NAME=flowy
|
||||||
export DB_PORT=5433
|
#export DB_PORT=5433
|
||||||
export DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@localhost:${DB_PORT}/${DB_NAME}
|
#export DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@localhost:${DB_PORT}/${DB_NAME}
|
||||||
export ROOT = "./scripts/database"
|
#export DB_HOST = "localhost"
|
||||||
export DB_HOST = "localhost"
|
|
||||||
|
|
||||||
init_database:
|
init_database:
|
||||||
${ROOT}/init_database.sh
|
${ROOT}/init_database.sh
|
||||||
|
@ -13,11 +13,17 @@ fi
|
|||||||
if ! [ -x "$(command -v sqlx)" ]; then
|
if ! [ -x "$(command -v sqlx)" ]; then
|
||||||
echo >&2 "Error: `sqlx` is not installed."
|
echo >&2 "Error: `sqlx` is not installed."
|
||||||
echo >&2 "Use:"
|
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."
|
echo >&2 "to install it."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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}" ]]
|
if [[ -z "${SKIP_DOCKER}" ]]
|
||||||
then
|
then
|
||||||
RUNNING_POSTGRES_CONTAINER=$(docker ps --filter 'name=postgres' --format '{{.ID}}')
|
RUNNING_POSTGRES_CONTAINER=$(docker ps --filter 'name=postgres' --format '{{.ID}}')
|
||||||
@ -28,12 +34,12 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
docker run \
|
docker run \
|
||||||
--name="flowy" \
|
|
||||||
-e POSTGRES_USER=${DB_USER} \
|
-e POSTGRES_USER=${DB_USER} \
|
||||||
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
|
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
|
||||||
-e POSTGRES_DB=${DB_NAME} \
|
-e POSTGRES_DB="${DB_NAME}" \
|
||||||
-p "${DB_PORT}":5432 \
|
-p "${DB_PORT}":5432 \
|
||||||
-d postgres \
|
-d postgres \
|
||||||
|
--name "postgres_$(date '+%s')" \
|
||||||
postgres -N 1000
|
postgres -N 1000
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user