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

Add Drush Launcher to the project to better support site installed Drush 9 #38

Closed
frederickjh opened this issue Mar 24, 2018 · 7 comments
Assignees

Comments

@frederickjh
Copy link

Currently one must be in the Drupal Webroot to use Drush. With projects moving to Drush 9 which is only supported installed per project adding the Drush Launcher makes sense.

Adding the Drush Launcher would allow running drush commands anywhere in a composer managed project and would automatically use the version of Drush installed in the project.

To allow Drush Launcher to fallback for projects that do not have Drush as part of the project (Drupal 7) the environmental variable DRUSH_LAUNCHER_FALLBACK should be set to the path to the globally installed Drush 8. The path to the Drush Launcher should be added to the $PATH so that it comes before any other drush command files.

See the command in this Drush Launcher issue for a command that will install the most recent version without having to update it each time a new version comes out.

@lmakarov lmakarov self-assigned this Mar 27, 2018
@lmakarov
Copy link
Member

Available in the edge images and will be release in docksal/cli v2.1.0

@lmakarov lmakarov mentioned this issue Apr 5, 2018
@amjad-wp
Copy link

@lmakarov Just read now how would I add this flag ?

At the moment I am just using following to get access to legacy Drush
echo "alias drush=/usr/local/bin/drush8" >> ~/.bashrc && source ~/.bashrc

Is there any better way ?

@frederickjh
Copy link
Author

In your Docksal project's .docksal/docksal.env or if this is only for you in your .docksal/docksal-local.env (not in ~/.docksal/docksal.env):

DRUSH_LAUNCHER_FALLBACK=/usr/local/bin/drush8

TIP: The Docksal project files.docsal-local.env and .docksal-local.env are for your local changes and should not be committed to your git repository. docksal.env and .docksal.yml are for all the configuration that should be shared with anyone else that needs to get the project up and running in Docksal.

@amjad-wp
Copy link

Tacos to you my friend. You're a champion.

@lmakarov
Copy link
Member

@amjad-wp, @frederickjh you normally don't need to do anything, as long as you are on the latest Docksal version using the default stack.

If you have a custom stack defined in .docksal/docksal.yml in you project, then, either update image versions there, or switch to using the default stack. The default stack is updated automatically when you update Docksal. Using the default stack is the recommended way for most users. Take a look at how it is being used in https://github.com/docksal/drupal8

It is possible, that even with the default stack you have image versions pinned in .docksal/docksal.env of you project. If that is the case, then, either update the pinned versions, or don't pin at all (unless you know what you are doing).

@frederickjh
Copy link
Author

@lmakarov I am not using this myself, as I haven't had a need to, it just works as you say. I was just explaining how to set a environmental variable in a Docksal project container.

@amjad-wp
Copy link

@lmakarov I have switched to dev version few days back. For debugging issue docksal/docksal#800

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

No branches or pull requests

3 participants