Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Dotenv support for drupal-project #73

Merged
merged 2 commits into from
Dec 16, 2019
Merged

Dotenv support for drupal-project #73

merged 2 commits into from
Dec 16, 2019

Conversation

wxactly
Copy link
Member

@wxactly wxactly commented Dec 13, 2019

Pulling this in from drupal-composer#351

My main use case for this is to enable drush options to be configured via the project's .env file... like this:

DRUSH_OPTIONS_URI=https://web.tt.localhost

Copy link

@mariacha mariacha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this a lot -- I did the same sort of thing this way:

3a544d2#diff-e7046e9d814dabe276a9e98710efc8b5

but copying over that example.drush.yml file isn't documented anywhere, and is much harder than adding something to the .env file.

That being said -- I couldn't get this to work on a fresh download of the drupal project -- I can see that my DRUSH_OPTIONS_URI=https://web.drupal-project.localhost/ is being read into the load.environment.php file, but my drush uli keeps popping me into http://example.com/subdir/user/reset/...

Any idea what might be happening there? Does it work for you locally? I'm wondering if it's something to do with the drush version, which is probably defaulting to 10 in drupal project.

@wxactly
Copy link
Member Author

wxactly commented Dec 16, 2019

@mariacha - Funny, the reason I started looking at other options is because I couldn't get the local drush.yml override working on my local project! 😩😩

I just tested this this morning on a brand new drupal-project of my own (drush 10.1.1). I copied the changes over from this branch, added DRUSH_OPTIONS_URI=https://web.new-project-name.localhost to my .env file, and it worked! Wonder how else I can help troubleshoot your local project, hmm...

@mariacha
Copy link

I'll keep debugging. It's got to be something about my local setup.

@wxactly
Copy link
Member Author

wxactly commented Dec 16, 2019

It actually seems suspicious that is is redirecting you to example.com, as opposed to just default? Do you have some other base uri settings set up on your machine somewhere?

@mariacha
Copy link

Right you are! I had a drush.yml file in my ~/.drush folder from when I ran the drush site:alias-convert command however long ago. So that solves it. This works great! Mind adding a bit about this to the README.md file though?

@wxactly
Copy link
Member Author

wxactly commented Dec 16, 2019

Absolutely @mariacha - done! Can you take a look and edit/move that section around if it doesn't feel quite right to you?

@mariacha
Copy link

I think that's great. Thanks!

@mariacha mariacha merged commit 4770ec6 into 8.x-pantheon Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants