mohatt / dashbrew

Vagrant build for developing PHP projects on different PHP versions and configurations
492 stars 38 forks source link

Symlinking project folders in public/ #27

Open wdmtech opened 9 years ago

wdmtech commented 9 years ago

I've tried symlinking a project folder from ~/Dev/myblog to public/myblog/ but it's not getting added during provisioning. I have .dashbrew and index.php files at the symlink's target. Are symlinked project folders supported by dashbrew?

OSX Yosemite 10.10.2

te-gpm commented 9 years ago

I'm trying to get the same thing working, no luck yet :( Is there any chance this might get supported? Would love to be able to just symlink new projects and provision :)

Tried both on OSX Yosemite and Ubuntu 14.10

wdmtech commented 9 years ago

It looks like the synced folder type doesn't support symlinks, but I know rsync does, so I am going to try changing:

config.vm.synced_folder "public/", "/var/www/", group: 'www-data', :owner => "vagrant"

in the Vagrantfile to use rsync instead and see what happens!

te-gpm commented 9 years ago

Did you have any success? Care to share your possible solution? :)

wdmtech commented 9 years ago

Not yet! Will see if I can have a go at it tonight :)

wdmtech commented 9 years ago

Have tried various options in an attempt to get rsync to sync a symlinked folder's contents to the guest, but I've not been able to get it to follow a symlink in such a manner.

config.vm.synced_folder "public/", "/var/www/", group: 'www-data', :owner => "vagrant", type: "rsync", rsync__args: ["--verbose", "-rLKptgod", "-z"]
vkvasnytsky commented 9 years ago

Try to create a folder with .dashboard, run provisioner and replace the folder with a symlink.

te-gpm commented 9 years ago

@phpid Not working for me, as soon as I symlink and provision the project is no longer detected and thrown out upon provisioning :(

vkvasnytsky commented 9 years ago
  1. create folder
  2. provision
  3. replace folder by a link
te-gpm commented 9 years ago

Unfortunatelly that always results in a 403, no matter how generous I set the file permissions. After halting the machine and upping again it no longer detects the symlinked project and throws it out :(

vkvasnytsky commented 9 years ago

It will NOT detect linked directories. Current implementation of the provisioner is looking for physical folders. You can either replace a folder by a link after provision or patch the provisioner to include linked folders.

wdmtech commented 9 years ago

Thanks @phpid, which synced/shared method should we use for this? (MacOS)

vkvasnytsky commented 9 years ago

It really depends on a size of your project. I tried shared folders, NFS and Parallels provider due to a size of my project - 40K files and 12K directories. It does not matter for a small project. Otherwise, Parallels or VMWare will be the best choice.