0

I have just made the following Homestead.yaml file:

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/GIT/old-project
      to: /home/vagrant/old-project
    - map: ~/GIT/project
      to: /home/vagrant/project

sites:
    - map: old-project.app
      to: /home/vagrant/old-project/public
    - map: project.app
      to: /home/vagrant/project/public

databases:
    - name: old-project
    - name: project

variables:
    - key: APP_ENV
      value: local

old-project already existed. Next I ran vagrant up, then vagrant ssh then inside the vagrant box I ran composer create-project laravel/laravel project 4.2 --prefer-dist. Laravel installed. I edited my /etc/hosts file and now project.app leads me to the Laravel 'You have arrived' page. Great – everything works.

But on my mac, the folder ~/GIT/project is empty.

What part of the installation process did I miss? Is there anything I've done wrong that has prevented the files from mapping across correctly?

If I open ~/GIT/old-project all the Laravel files are there, and it works as I'd expect. I can't remember any difference in how I set up that project.

Djave
  • 8,595
  • 8
  • 70
  • 124

1 Answers1

1

I guess you should run the vagrant provision command, to make the added directory (~/GIT/project) shared with the homestead.

When you run the command vagrant up for the first time, the directory ~/GIT/old-project became shared with the homestead. However the directory ~/GIT/project is not shared therefore it is empty on your mac.

Note: When running the provision command, your existing databases will be destroyed and recreated.

Pantelis Peslis
  • 14,930
  • 5
  • 44
  • 45
  • I did six things [deleted the folder, recreated the folder, installed Laravel, ran vagrant provision, vagrant halt, vagrant up] repeatedly in a random order until it all worked OK! In future I will make sure the folder exists first of all. – Djave Apr 09 '15 at 08:31
  • My way to avoid this, is to map a main folder into `yaml` file and then every site maps to a subfolder of the main folder. – Pantelis Peslis Apr 09 '15 at 17:00