From 802584c0af9a9fd1b874546b648841a4c1759d60 Mon Sep 17 00:00:00 2001 From: Bill Seremetis Date: Tue, 19 Nov 2024 12:59:56 +0200 Subject: [PATCH] Restore remote-db command with .env file --- README.md | 4 ++-- commands/host/remote-db | 4 ++-- install.yaml | 5 +++++ scripts/sample.env | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index aaf43d6..f9f4c4b 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,8 @@ git add .ddev/commands/host/devmode -f git add .ddev/commands/host/githooks -f git add .ddev/commands/host/login -f git add .ddev/commands/host/protect -f -git add .ddev/commands/host/open-issue -f git add .ddev/commands/host/remote-db -f git add .ddev/commands/host/timeslip -f -git add .ddev/commands/host/timew -f git add .ddev/commands/web/behat -f git add .ddev/commands/web/robo -f git add .ddev/commands/web/platform -f @@ -61,6 +59,8 @@ git add .ddev/scripts/ -f git add .ddev/config.hooks.yaml -f git add .ddev/settings.local.*mode.php -f +git add .ddev/.env -f + git add .ddev/addon-metadata/ -f git add .vscode -f diff --git a/commands/host/remote-db b/commands/host/remote-db index 28f425e..0e5464d 100755 --- a/commands/host/remote-db +++ b/commands/host/remote-db @@ -5,9 +5,9 @@ ## Usage: remote-db ## Example: "ddev remote-db" -if [ -f "${DDEV_APPROOT}/.env" ]; then +if [ -f "${DDEV_APPROOT}/.ddev/.env" ]; then set -a - source "${DDEV_APPROOT}/.env" + source "${DDEV_APPROOT}/.ddev/.env" set +a if [[ $DDEV_UPSTREAM_PROVIDER ]]; then ddev pull $DDEV_UPSTREAM_PROVIDER --skip-files -y diff --git a/install.yaml b/install.yaml index f25a8c5..0f709f6 100644 --- a/install.yaml +++ b/install.yaml @@ -124,6 +124,11 @@ post_install_actions: - cp -r ${DDEV_APPROOT}/.ddev/scripts/.vscode ${DDEV_APPROOT}/ - cp -r ${DDEV_APPROOT}/.ddev/scripts/git-hooks/commit-msg ${DDEV_APPROOT}/.git/hooks/commit-msg - chmod +x ${DDEV_APPROOT}/.git/hooks/commit-msg + - | + if [ ! -f ${DDEV_APPROOT}/.ddev/.env ]; then + cp ${DDEV_APPROOT}/.ddev/scripts/sample.env ${DDEV_APPROOT}/.ddev/.env + echo "Please configure upstream provider in .ddev/.env file!" + fi # Shell actions that can be done during removal of the add-on. # Files listed in project_files section will be automatically removed here if they contain #ddev-generated line. diff --git a/scripts/sample.env b/scripts/sample.env index e6233f8..b4f18d6 100644 --- a/scripts/sample.env +++ b/scripts/sample.env @@ -1,6 +1,6 @@ #ddev-generated # Change DDEV_UPSTREAM_PROVIDER to where `ddev pull` should look for a DB. -# It is used in `.ddev/commands/host/fetchdb` +# It is used in `.ddev/commands/host/remote-db` # Example values: # - platform # - pantheon