Skip to content

Commit

Permalink
issue #87 Update pull to get database credentials from the environmen…
Browse files Browse the repository at this point in the history
…t, use hardcoded only if not env not set. (#88)
  • Loading branch information
luzzardi authored Dec 9, 2022
1 parent cefdab8 commit 944ed73
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 944ed73

Please sign in to comment.