Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #7 from latera/HOMS-226
Browse files Browse the repository at this point in the history
HOMS-226 Set DB credentials with env variables
  • Loading branch information
Timofey Alekperov authored Oct 9, 2018
2 parents 61084d8 + f7a0af6 commit fdd0bf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion entrypoint_ah.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
set -m

bash /entrypoint.sh &
/wait_for_postgres.sh

/entrypoint.sh &
if [ $? -ne 0 ]; then
echo "Container start failed, now exiting..."
exit
Expand Down
7 changes: 4 additions & 3 deletions wait_for_postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

set -e

host="$1"
export PGHOST=$BPM_DB_HOST
export PGUSER=$BPM_DB_USER
export PGPASSWORD=$BPM_DB_PASSWORD

until psql -h "$host" -U "postgres" -c '\q'; do
until psql -c '\q'; do
>&2 echo "Postgres is unavailable - sleeping"
sleep 1
done

>&2 echo "Postgres is up"
exit 0

0 comments on commit fdd0bf3

Please sign in to comment.