Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting uri in drush.yml does not set the base uri #3121

Closed
eiriksm opened this issue Oct 31, 2017 · 7 comments
Closed

Setting uri in drush.yml does not set the base uri #3121

eiriksm opened this issue Oct 31, 2017 · 7 comments

Comments

@eiriksm
Copy link
Contributor

eiriksm commented Oct 31, 2017

Added a drush.yml file to all of these location, containing the following:

options:
  uri: 'http://devsite.dev'

Locations:

  • ./drush.yml
  • ./drush/drush.yml
  • ./drupal/drush/drush.yml
  • ./drupal/sites/default/drush.yml

Based on the example.drush.yml file: https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml#L92

Expected result:

The uri should be set, for example for uli commands.

@basvdheijden
Copy link
Contributor

This doesn't seem to work in all cases.
When I have a site installed in http://devsite.dev/suffix, I have devsite.dev.suffix inside my sites.php file. and If I now run drush -l http://devsite.dev/suffix it doesn't pick up the suffix site (because it's supposed to be a dot). drush -l http://devsite.dev.suffix works fine, but then the base URI is wrong.

@weitzman
Copy link
Member

weitzman commented Nov 30, 2017 via email

@gitressa
Copy link
Contributor

gitressa commented Feb 2, 2018

Including a drush.yml file in ./web/sites/default and adding the following in that file doesn't seem to get picked up:

options:
  uri: 'http://devsite.dev/test/sub'

However, it does works if I add it in ./vendor/drush/drush/drush.yml.

But as @basvdheijden also notes, sub-directories are not included. I am using the versions below. (note: I am using Drush Launcher):

$ drush st
Drupal version   : 8.4.4
Site URI         : http://devsite.dev/test/sub
PHP binary       : /usr/bin/php7.0
PHP config       : /etc/php/7.0/cli/php.ini
Drush script     : /usr/local/bin/drush
Drush version    : 9.0.0
Drush configs    : /var/www/public/devsite.dev/vendor/drush/drush/drush.yml

Result:

$ drush uli -l http://devsite.dev/test/sub
http://devsite.dev/user/reset/1/1517571880/F2oV85Oj1AmZFH7srg1TKlb_PW1OFtFQgl4ca3Bj2cI/login

$ drush uli -l http://devsite.dev.test.sub
http://devsite.dev.test.sub/user/reset/1/1517571887/Kq_BovW9Ej_064dZvHTnrmu3X6eKnuCWLBB_cAtt9yg/login

$ drush uli
http://devsite.dev/user/reset/1/1517571894/nQ2paPxzjQ0KuDTqjXQkrUHPqIpc8cgOXdbN5hKM06M/login

@weitzman
Copy link
Member

sites/default is not a valid place for setting uri. site specific dirs are loaded its too late in the bootstrap. use ./drush/drush.yml

@gitressa
Copy link
Contributor

Thanks @weitzman, that works perfectly. Sub-paths are still ignored though.

./drush/drush.yml, content:

options:
  uri: 'http://devsite.dev/test/sub'

Result:

$ drush uli
http://devsite.dev/user/reset/1/1518426060/R5QDzFAIZAPueFyJpyLGInoXEWAitSjFCf-ev5odnig/login

@weitzman
Copy link
Member

That sounds like #3166

@gitressa
Copy link
Contributor

Ah yes, I will follow that issue for a solution to ignored sub-paths, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants