shopwareArchive / shopware-platform-vagrant

DEPRECATED: A Vagrant setup ready for shopware platform development
22 stars 14 forks source link

No synced_folder setting in Vagrantfile #7

Closed lrotermund closed 4 years ago

lrotermund commented 4 years ago

Hello everyone,

thank you for providing a shopware vagrant repository. Shopware development is much easier with a clean prepared development environment.

Today I tried to setup your package. Everything works great. Shopware is running and is accessable.

Up to now there is no synced folder setting for the plugin folder, so I'll try to set my own vm.synced_folder setting inside the Vagrantfile:

config.vm.synced_folder "/home/user/Repositories/shopware-platform-vagrant/plugins", "/home/vagrant/shopware-dev/custom/plugins", create: true, owner: "vagrant",
  group: "vagrant", :mount_options => ["dmode=755,fmode=755"]

Im not used to modify this file and Im not sure if the syntax is correct. Is this the correct setting entry to add and modify synced plugins?

In your old vagrant repository there was a disabled setting for syncing the folders:

#config.vm.synced_folder "../src", "/home/vagrant/www/shopware", create: true, type: "smb"
#config.vm.synced_folder "../src", "/home/vagrant/www/shopware", create: true, type: "nfs"
#config.vm.synced_folder "../src", "/home/vagrant/www/shopware", create: true;

Do you attent to add the Vagrantfile setting in the future? Thank you for considering my question.

flohessling commented 4 years ago

Hey Sunvers,

thank you, we are glad that this setup makes your job easier!

I intentionally left out the synced folder option because there have been problems with other operating systems in the past. The synced folder option depends on your host operating system and it slowed down vagrant setups on Mac and Windows. So our approach was to treat the vagrant environment like a remote web server and to use SFTP, SCP or any other client to handle files inside the VM. This is why we do not add the option to the Vagrantfile.

If you want to use the synced folder option feel free to add it to your setup. There are some parameters to consider and they depend on your host operating system. You can't use the NFS option on Windows hosts for example.

Here you can find the Vagrant documentation for synced folders: https://www.vagrantup.com/docs/synced-folders/

The basic config for a synced plugins folder would be: config.vm.synced_folder "plugins/", "/home/vagrant/shopware-dev/custom/plugins"

Keep in mind that the first folder is the folder on your host and it's path is relative to your Vagrantfile (in this case the plugins folder should be in the same directory as the Vagrantfile).

If you are using Linux you can add the parameter type: nfs and here is a blog post explaining some options on your host to speed up the nfs-snyced-folder: https://blog.theodo.com/2017/07/speed-vagrant-synced-folders/

I hope you understand why we do not intend to add the synced folders. Also i do hope that i could give you a little insight and help you to add the functions for your needs.

Thank you for your interest in Shopware!

lrotermund commented 4 years ago

Thank you for your fast and detailed answer. I'm using Linux and I'll try to add the synced folder based on your example. Thank you!