Skip to content

Commit

Permalink
Restore remote-db command with .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
bserem committed Nov 19, 2024
1 parent f7f8bd1 commit 802584c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions commands/host/remote-db
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion scripts/sample.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 802584c

Please sign in to comment.