Skip to content

Commit

Permalink
issue docksal#87 Update pull to get database credentials from the env…
Browse files Browse the repository at this point in the history
…ironment, use hardcoded only if not env not set.
  • Loading branch information
luzzardi committed Aug 22, 2022
1 parent 3f78289 commit 9404909
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pull/pull
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,15 @@ provider_pull_db ()

echo-green "Pulling DB"

# Variables to set for local use.
local __db_user="${dbuser:-root}"
local __db_password="${dbpass:-root}"
local __db_database="${dbname:-default}"
# Get database environment variables.
DB_USER=${MYSQL_USER:-root}
DB_PASS=${MYSQL_PASSWORD:-root}
DB_NAME=${MYSQL_DATABASE:-default}

# Variables to set for local use.
local __db_user="${dbuser:-${DB_USER}}"
local __db_password="${dbpass:-${DB_PASS}}"
local __db_database="${dbname:-${DB_NAME}}"

# Set the db file that will be stored within the cli container
local db_file="/tmp/${__db_database}.${hostingenv}.${hostingsite}.sql.gz"
Expand Down

0 comments on commit 9404909

Please sign in to comment.