movbed pg password check
This commit is contained in:
parent
8010ee3dca
commit
8d3419952c
10
boot.sh
10
boot.sh
@ -21,10 +21,6 @@ if [ -z "${SECRET_KEY}" ]; then
|
|||||||
display_warning "The environment variable 'SECRET_KEY' is not set but REQUIRED for running Tandoor!"
|
display_warning "The environment variable 'SECRET_KEY' is not set but REQUIRED for running Tandoor!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# POSTGRES_PASSWORD must be set in .env file
|
|
||||||
if [ -z "${POSTGRES_PASSWORD}" ]; then
|
|
||||||
display_warning "The environment variable 'POSTGRES_PASSWORD' is not set but REQUIRED for running Tandoor!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Waiting for database to be ready..."
|
echo "Waiting for database to be ready..."
|
||||||
|
|
||||||
@ -32,6 +28,12 @@ attempt=0
|
|||||||
max_attempts=20
|
max_attempts=20
|
||||||
|
|
||||||
if [ "${DB_ENGINE}" != 'django.db.backends.sqlite3' ]; then
|
if [ "${DB_ENGINE}" != 'django.db.backends.sqlite3' ]; then
|
||||||
|
|
||||||
|
# POSTGRES_PASSWORD must be set in .env file
|
||||||
|
if [ -z "${POSTGRES_PASSWORD}" ]; then
|
||||||
|
display_warning "The environment variable 'POSTGRES_PASSWORD' is not set but REQUIRED for running Tandoor!"
|
||||||
|
fi
|
||||||
|
|
||||||
while pg_isready --host=${POSTGRES_HOST} -q; status=$?; attempt=$((attempt+1)); [ $status -ne 0 ] && [ $attempt -le $max_attempts ]; do
|
while pg_isready --host=${POSTGRES_HOST} -q; status=$?; attempt=$((attempt+1)); [ $status -ne 0 ] && [ $attempt -le $max_attempts ]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user