You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
drush.settings.php doesn't seem to work (on host), is also unmanaged and unhidden from git #454
When doing a site setup with ddev import-db (I think) on a drupal site we drop a drush.settings.php into the root of the repo (and include it from our generated settings.php). This was intended to allow access using drush from the host.
I don't think it works for running drush from the host right now: drush sql-cli on the host gets me various errors including include(): Failed opening [warning] '/Users/rfay/workspace/palisadeartlovers/docroot/sites/default../../../drush.settings.php'
We drop the file into the root of the repository. Unless the user adds it to gitignore or something, it becomes somewhat of an eyesore when attempting to maintain the repo.
What you expected to happen:
How to reproduce this:
Version: Please include the output of ddev version, docker version and the project's .ddev/config.yaml.
drush.settings.php is also the only user of $DEPLOY_NAME (which is always set to 'local'). It seems to be using it as a flag to detect whether drush is running in the container or on the host.
DEPLOY_NAME should probably be removed in all its usages. A better-named env var might be appropriate. Bottom line is
drush.settings.php should work if it's going to exist
If it needs an env var in the container the env should be named better and have a useful value.
So for platform-docker I defined PLATFORM_DOCKER with the project name in the FPM and Nginx containers. This allowed me to know if I was in the host or not.
This can be used to load the drush.settings.php. However this causes Console to break. I think there should be host.settings.php which is loaded whenever the env is missing.
When I run ddev start, my service ports are mapped to .ddev/ports.json
When I run ddev stop my service port maps are removed
When I run a CLI tool on my host, the CMS can be bootstrapped by services using port defined in .ddev/ports.json
This would allow Solr, MySQL/Maria, Elastic, Redis support on host command line. I picked JSON because it's most easy thing to serialize/unserialize across languages.
So regardless if WP-CLI, Drush, Console, whatever. Each CMS can support a host settings.
Hmm. Looks like a bug and therefore we'll want to prioritize it sooner than later. Not quite sure I feel like we've converged on a particular solution at the moment, but it looks like we have options.
Activity
rfay commentedon Dec 8, 2017
drush.settings.php is also the only user of $DEPLOY_NAME (which is always set to 'local'). It seems to be using it as a flag to detect whether drush is running in the container or on the host.
DEPLOY_NAME should probably be removed in all its usages. A better-named env var might be appropriate. Bottom line is
mglaman commentedon Feb 26, 2018
So for platform-docker I defined
PLATFORM_DOCKERwith the project name in the FPM and Nginx containers. This allowed me to know if I was in the host or not.This can be used to load the drush.settings.php. However this causes Console to break. I think there should be
host.settings.phpwhich is loaded whenever the env is missing.It could have something like this https://github.com/mglaman/platform-docker/blob/develop/resources/stacks/drupal8/settings.local.php
Instead of my hack to call
dockerto get ports inwhat if
ddev startreplaced the port somehow?mglaman commentedon Feb 27, 2018
Thoughts on
ddev start, my service ports are mapped to.ddev/ports.jsonddev stopmy service port maps are removed.ddev/ports.jsonThis would allow Solr, MySQL/Maria, Elastic, Redis support on host command line. I picked JSON because it's most easy thing to serialize/unserialize across languages.
So regardless if WP-CLI, Drush, Console, whatever. Each CMS can support a host settings.
rickmanelius commentedon Feb 28, 2018
Hmm. Looks like a bug and therefore we'll want to prioritize it sooner than later. Not quite sure I feel like we've converged on a particular solution at the moment, but it looks like we have options.
mglaman commentedon Feb 28, 2018
I moved my ideas into #691 so this could be worked on as a bug fix and not bloat the scope.
mglaman commentedon Feb 28, 2018
Note: this can only be reproduced if you ran a database import.