To download Vagrant for supported platforms, see here
If choosing VirtualBox as your virtualization provider, see here.
You may have to enable hardware virtualization extensions in your BIOS before using it.
If running on Ubuntu, you may have to install a newer version of VirtualBox than what is available in the public repositories in order for it to work correctly with Vagrant.
It is required in order to properly handle shared folders and communication between the host and the guest. Install it with the Vagrant plugin:
vagrant plugin install vagrant-vbguest
The Vagrantfile relies on this plugin.
Once Vagrant has been installed, you can start an environment by checking out the REPAiR-Web code, then changing to the directory which contains the Vagrantfile by typing:
# Windows users will need to uncomment the line ending configuration option.
git clone git@github.com:MaxBo/REPAiR-Web.git REPAiR-Web #--config core.autocrlf=input
cd REPAiR-Web
vagrant up
If you would like to use Parallels instead of VirtualBox, please run the following command:
vagrant up --provider=parallels
Please note that this requires the Parallels Vagrant plugin, which can be installed:
vagrant plugin install vagrant-parallels
Similarly, if you would like to use VMware Workstation instead of VirtualBox, please run the following command:
vagrant up --provider vmware_workstation
Please note that this requires the VMware Vagrant plugin, which can be installed:
vagrant plugin install vagrant-vmware-workstation
The initialization of the vagrant vm (vagrant up
) will take about ten minutes at first.
You should be able to log into the running VM by typing:
vagrant ssh
Within this login shell, you can build the code, run the server or the tests. With the initialization of the vm (provisioning), also the Node.js and Django server are started with hot reloading. Django is listening to 0.0.0.0:80
on the guest, which is forwarded to localhost:8081
on the host.
The REPAiR-Web root folder (on host) is mapped to the /home/vagrant/REPAiR-Web
folder on the guest.
See the details on how the vm is provisioned in VagrantProvisionUbuntu1604.sh
The provisioning script starts both the node and django servers, thus the content is served on localhost:8081
on the host. However, after stopping the VM (vagrant halt
) at the end of the day for example, both servers stop and need to be manually started after vagrant up
is issued again.
From the REPAiR-Web
directory in the vagrant machine, use the vagrant_start-node.sh
and vagrant_start-django.sh
scripts to start the servers. The Node server need to be restarted every time a change is made to the JS files. For this use CTRL-C and start the server again. The Django server restarts itself automatically, but if you need to stop it, also use CTRL-C.
Acknowledgement
The majority of this description was taken from the Hootenanny project