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
ddev ssh (maybe) should land in root /var/www/html not docroot (implement working_directory config) #505
I got myself confused today on a site that had a docroot because I was using ddev ssh, which currently takes people to the docroot, hiding the fact that their actual root is one down. IMO we should ddev ssh into the root of the mount. In my case, that means if I'm in ~/workspace/drupal8 and I ddev ssh I'll end up in /var/www/html, not (as currently) /var/www/html/docroot
Note that I believe ddev exec might still have to land in the docroot, for things like drush to work predictably. And of course that's the argument for us to land ddev ssh in the docroot.
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.
changed the title [-]ddev ssh should land in root /var/www/html not docroot[/-][+]ddev ssh (maybe) should land in root /var/www/html not docroot[/+]on Dec 4, 2017
changed the title [-]ddev ssh (maybe) should land in root /var/www/html not docroot[/-][+]ddev ssh (maybe) should land in root /var/www/html not docroot (implement working_directory config)[/+]on Jan 30, 2018
Added "needs decision" to this because it needs a conversation. What we'd do with this affects exec (probably), hooks (possibly). Very much affects drush behavior. I just think we should talk through the implications.
It sounds like there are two factors at player here: user expectation and usefulness. On the expectation side, I can see how one might expect to land in the mount root versus docroot. On the usefulness side, it might help to get a few examples of when ddev exec would be better served running from the mount versus the docroot.
Another thing to consider is that some codebases will have the two match and others will have (usually) one folder level difference.
I guess I'm not sold yet because a user would have already configured the docroot to indicate where nginx should serve from and I see that as a major source of confusion. However, by that logic we could have just as easily set the default behavior to the execute from the mount. That said, having a basic drush command behave differently based on whether the docroot and mount folder were the same or not seems like it would lead to more frustration. And to that end, I would be biased towards keeping it the way it is now.
Happy to discuss next week and see if the working directory config helps or adds more confusion.
The reason we love ddev ssh to land in docroot is that it makes drush work out of the box, maybe wp-cli too. But we can certainly make drush work in the project root, we have the tools, already create a drush settings file, so we can just solve that one and we'll be happy with ddev ssh landing in project root I think. The issue for drush settings is #454
One reason for not landing in root: RoboCLI or Phing. What if I have a task runner I am expecting to not run in the root context?
Perhaps there could be a --docroot flag to automatically switch to executing in the docroot? But then the use case of Drush/Console/WP-CLI become more cumbersome.
Platform.sh CLI has a specific Drush command helper. Would it kill to have
ddev exec for arbitrary commands, with --docroot support
ddev drush which executes drush in docroot or with --root
ddec wpcli which executes WP-CLI in docroot
This also makes adoption easier as these common commands no longer need an extra step ddev drush is easier than ddev exec drush
I'm currently trying ddev and was confused that ddev exec uses the webroot as working directory. The main reason for me is composer and dedicated web-directories: The composer.json will often (if not always) reside in the root-directory of the project. So simply running ddev exec composer install will fail and you have to set the working directory manually with ddev exec composer -d /var/www/html install.
What about detecting the current directory (root or web or XYZ) and automatically use this as working directory for ddev exec|ssh?
I am agreed with @rfay and @HenningCash because right now, we have a repo with composer and Drupal 8. Drupal 8 has a docroot. So today I have to run with a long command like ddev exec composer install -d /var/www/html. So it would be great to give us the options like root or docroot.
Activity
[-]ddev ssh should land in root /var/www/html not docroot[/-][+]ddev ssh (maybe) should land in root /var/www/html not docroot[/+]rfay commentedon Jan 24, 2018
One suggestion for this is to add a configuration for "working directory", and ddev ssh and ddev exec would land there.
[-]ddev ssh (maybe) should land in root /var/www/html not docroot[/-][+]ddev ssh (maybe) should land in root /var/www/html not docroot (implement working_directory config)[/+]rfay commentedon Feb 21, 2018
Added "needs decision" to this because it needs a conversation. What we'd do with this affects exec (probably), hooks (possibly). Very much affects drush behavior. I just think we should talk through the implications.
rickmanelius commentedon Feb 23, 2018
It sounds like there are two factors at player here: user expectation and usefulness. On the expectation side, I can see how one might expect to land in the mount root versus docroot. On the usefulness side, it might help to get a few examples of when ddev exec would be better served running from the mount versus the docroot.
Another thing to consider is that some codebases will have the two match and others will have (usually) one folder level difference.
I guess I'm not sold yet because a user would have already configured the docroot to indicate where nginx should serve from and I see that as a major source of confusion. However, by that logic we could have just as easily set the default behavior to the execute from the mount. That said, having a basic drush command behave differently based on whether the docroot and mount folder were the same or not seems like it would lead to more frustration. And to that end, I would be biased towards keeping it the way it is now.
Happy to discuss next week and see if the working directory config helps or adds more confusion.
rfay commentedon Feb 24, 2018
The reason we love
ddev sshto land in docroot is that it makes drush work out of the box, maybe wp-cli too. But we can certainly make drush work in the project root, we have the tools, already create a drush settings file, so we can just solve that one and we'll be happy with ddev ssh landing in project root I think. The issue for drush settings is #454mglaman commentedon Feb 26, 2018
One reason for not landing in root: RoboCLI or Phing. What if I have a task runner I am expecting to not run in the root context?
Perhaps there could be a
--docrootflag to automatically switch to executing in the docroot? But then the use case of Drush/Console/WP-CLI become more cumbersome.Platform.sh CLI has a specific Drush command helper. Would it kill to have
ddev execfor arbitrary commands, with--docrootsupportddev drushwhich executes drush in docroot or with--rootddec wpcliwhich executes WP-CLI in docrootThis also makes adoption easier as these common commands no longer need an extra step
ddev drushis easier thanddev exec drushHenningCash commentedon May 12, 2018
I'm currently trying ddev and was confused that
ddev execuses the webroot as working directory. The main reason for me is composer and dedicated web-directories: The composer.json will often (if not always) reside in the root-directory of the project. So simply runningddev exec composer installwill fail and you have to set the working directory manually withddev exec composer -d /var/www/html install.What about detecting the current directory (root or web or XYZ) and automatically use this as working directory for
ddev exec|ssh?truls1502 commentedon Jul 15, 2018
I am agreed with @rfay and @HenningCash because right now, we have a repo with composer and Drupal 8. Drupal 8 has a docroot. So today I have to run with a long command like
ddev exec composer install -d /var/www/html. So it would be great to give us the options like root or docroot.test(apple-container): link skips and HANDOFF to socktainer#504 and d…
test(apple-container): link skips and HANDOFF to socktainer#504 and d…
22 remaining items
docs(apple-container): record socktainer main test results, skip a pr…
docs(apple-container): record ddev#505 fix and remaining cmd test res…
docs(apple-container): record socktainer#513 and the docker cp metada…
docs(apple-container): record socktainer main test results, skip a pr…
docs(apple-container): record ddev#505 fix and remaining cmd test res…
docs(apple-container): record socktainer#513 and the docker cp metada…
docs(apple-container): record socktainer main test results, skip a pr…
docs(apple-container): record ddev#505 fix and remaining cmd test res…
docs(apple-container): record socktainer#513 and the docker cp metada…
docs(apple-container): record socktainer main test results, skip a pr…
docs(apple-container): record ddev#505 fix and remaining cmd test res…
docs(apple-container): record socktainer#513 and the docker cp metada…
feat: experimental Apple Container support via socktainer, fixes ddev…
feat: experimental Apple Container support via socktainer, fixes ddev…
feat: experimental Apple Container support via socktainer, fixes ddev…