Motivation
Many developers use Vagrant for Drupal development. One problem with Drupal is that site implementations will have thousands of files, greatly slowing performance if the code is shared using Virtualbox or NFS. To solve this, Vagrant 1.5 supports using rsync to copy code edits to the virtual machine. This pretty much solves the performance problem.
Unfortunately, using drush features-update breaks this model since it updates code on the VM, and not on the host. If we could tell drush to treat /vagrant/www/docroot
as the site base instead of /var/www/docroot
, we can use the available (but slow) automatic mount to extract out our updates.
I thought about solving this with Vagrant (I've been using Unison previously to sync files), but when it comes down to it, it's Features and Drupal that is deciding that in-place code writes are OK, so I figure it's best solved here.
Solution
This patch adds a --base-path
option to drush features-update
(and features-update-all
). Developers can default this in drushrc.php
if they desire.
This also has the side benefit of making it super easy to export to a different Drupal site on the same file system.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2244869.1-drush-base-path.patch | 2.12 KB | deviantintegral |
Comments
Comment #1
deviantintegral CreditAttribution: deviantintegral commentedComment #2
deviantintegral CreditAttribution: deviantintegral commentedComment #3
Steven Merrill CreditAttribution: Steven Merrill commentedI also wrote https://github.com/smerrill/vagrant-rsync-back to deal with this exact problem.
Do a `drush fu`, or go to the UI and click "Generate Feature," then run `vagrant rsync-back` from the host.
Comment #4
hefox CreditAttribution: hefox commentedShould this be against drush core instead? (does it needs to know the root of the install for anything.. site install?)
Comment #5
Dave ReidIsn't this duplicating the existing Drush '--root' option?