You can deploy devdocs site locally using this vagrant project. Vagrant enables you to create a virtual machine with all the software needed to build the devdocs project on a virtual machine. The generated web-site is accessible through browser from your machine as localhost using IP: 127.0.0.1:4000 by default.
- Download or clone devdocs repository.
- Install VirtualBox.
- Install Vagrant.
- Using a terminal, change a directory to
devdocs/vagranton your host. (The directory where this README is located.) Example:cd ~/devdocs/vagrant - Enter in your terminal
vagrant up - Wait for some time until vagrant create a virtual machine with ready-to-go environment.
In your browser, visit http://127.0.0.1:4000/
You can change the following parameters in Vagrantfile
NAMEis a name of virtual machine (default: "magento.devdocs").HOST_PORTis a localhost port that enables you to observe the generated site from your host (default: "4000").RAMis a RAM size on virtual machine (default: "1024" MB).CPUis a maximum percentage of a CPU used on your machine for VM needs. (default: "50" percent)
All commands must be run in the terminal from the directory that contains Vagrantfile.
- Stop Jekyll server. (Stops devdocs site generation.)
vagrant ssh -c "kill $(ps aux | grep '[j]ekyll' | awk '{print $2}')" - Run Jekyll server. (Generates devdocs site.)
vagrant ssh -c 'cd /jekyll/devdocs; jekyll serve --host=0.0.0.0' - Reload Jekyll server. (Regenerates devdocs site.)
vagrant ssh -c "kill $(ps aux | grep '[j]ekyll' | awk '{print $2}'); cd /jekyll/devdocs; jekyll serve --host=0.0.0.0"
- Connect to the running virtual machine. You can run Jekyll commands inside the virtual machine from the
/jekyll/devdocsdirectory.To terminate the connection run the command:vagrant ssh
exit - Shut down the running virtual machine
vagrant halt
- Start and configure the virtual machine
vagrant up
- Stop and remove the virtual machine
vagrant destroy
- Reload virtual machine to apply changes in
Vagrantfilevagrant reload
- Reload virtual machine to apply changes in
Vagrantfileandbootstrap.shvagrant reload --provision
- Reload virtual machine to apply changes in
bootstrap.shvagrant provision