Skip to content

Commit

Permalink
Merge pull request #6 from mittwald/feature/database-id
Browse files Browse the repository at this point in the history
Allow database id to be set directly via environment variable
  • Loading branch information
martin-helmich authored Mar 11, 2024
2 parents e3447e0 + d3d155d commit 5719cbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion providers/mittwald.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ db_pull_command:
set -eu -o pipefail
database_output="/var/www/html/.ddev/.downloads/db.sql.gz"
database_id=$(mw app get -ojson | jq -r 'if has("linkedDatabases") then ((.linkedDatabases[] | select(.purpose == "primary")).databaseId) else empty end')
database_id="${MITTWALD_DATABASE_ID:-}"
if [[ -z "${database_id}" ]] ; then
database_id=$(mw app get -ojson | jq -r 'if has("linkedDatabases") then ((.linkedDatabases[] | select(.purpose == "primary")).databaseId) else empty end')
fi
if [[ -n "${database_id:-}" ]] ; then
mw database mysql dump "${database_id}" --gzip -o "${database_output}"
Expand Down

0 comments on commit 5719cbe

Please sign in to comment.