Commit d879d437 authored by Evili del Rio's avatar Evili del Rio

Correct postgresql host extraction from k8s-like environment vars

parent 5a249fa6
Pipeline #725 failed with stages
in 45 seconds
......@@ -84,7 +84,7 @@ export DJANGO_LOG_LEVEL=${DJANGO_LOG_LEVEL:-info}
# Select POSTGRES_HOST (if any and no other database definition available):
if [[ -z "${DJANGO_DATABASES}" && -z "${DATABASE_URL}" && -z "${POSTGRES_HOST}" ]]
then
p_host=$(/bin/printenv | /bin/egrep -e 'POSTGRES.*HOST' | /usr/bin/sort | /usr/bin/head -1)
p_host=$(/bin/printenv | /bin/egrep -e 'POSTGRES.*HOST' | /usr/bin/sort | /usr/bin/head -1 | /usr/bin/awk -F'=' '{print $2}')
if [[ -n ${p_host} ]]
then
export POSTGRES_HOST=${p_host}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment