Skip to content

Commit

Permalink
Merge pull request #680 from Fryguy/container_env_defaults
Browse files Browse the repository at this point in the history
Set defaults in container_env for dev usage
  • Loading branch information
bdunne authored May 7, 2024
2 parents 8f631bf + 9143165 commit 8a94eba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion container-assets/container_env
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ function urlescape() {

safeuser=$(urlescape ${DATABASE_USER})
safepass=$(urlescape ${DATABASE_PASSWORD})
if [ -z "${safeuser}" -o -z "${safepass}" ]; then
DATABASE_USERINFO=""
else
DATABASE_USERINFO="${safeuser}:${safepass}@"
fi

export DATABASE_URL="postgresql://${safeuser}:${safepass}@${DATABASE_HOSTNAME}:${DATABASE_PORT}/${DATABASE_NAME}?encoding=utf8&pool=25&wait_timeout=5"
export DATABASE_URL="postgresql://${DATABASE_USERINFO}${DATABASE_HOSTNAME:-localhost}:${DATABASE_PORT:-5432}/${DATABASE_NAME:-miq_bot_production}?encoding=utf8&pool=25&wait_timeout=5"

0 comments on commit 8a94eba

Please sign in to comment.