You can deploy devdocs site locally using this Vagrant project. Vagrant enables you to run the software needed to build the devdocs project in a self-contained virtual machine (VM). Our Vagrant project clones the devdocs repository. You can then run Jekyll from the /vagrant/devdocs
project root.
If you previously used Vagrant to clone and update the devdocs site, we strongly recommend you clone it again using this Vagrant project before making further updates. We recently renamed the 2.0
branch to develop
. We believe that having the old 2.0
branch in your Git history will cause issues.
Install the VirtualBox and Vagrant software for your operating system:
You can change the following parameters in Vagrantfile
:
NAME
is a name of virtual machine (default:magento-devdocs
).HOST_PORT
is a localhost port that enables you to observe the generated site from your host (default:4000
).RAM
is the amount of RAM used by the virtual VM (default:1024
MB).CPU
is the maximum percentage of CPU used for the VM. (default:50
percent).
To enable symlinks to work, Windows users must run both the UNIX shell (for example, Git Bash) and the VirtualBox application as administrator. The easiest way to do that is to modify the applications' shortcuts as follows:
- Right-click the application on your desktop or under Start > All Programs
- From the pop-up menu, click Properties.
- In the Properties dialog box, click Advanced.
- Select the Run as administrator check box.
- Follow the prompts on your screen to save your changes.
-
Using a terminal, change to
devdocs/vagrant
on your host (that is, the directory in which this README is located). Example:cd ~/vagrant/devdocs
-
Enter
vagrant up
-
Wait for the project to initialize and clone the repository.
This command takes some time to complete the first time you run it.
After your Vagrant project has started, enter vagrant ssh
to connect to the project using SSH. From there, you can fork the devdocs repository and use any editor to make your changes.
When you're ready to preview your changes, continue with the next section.
Use the following command to run Jekyll:
bin/jekyll serve --host=0.0.0.0
For additional command options, see Basic Usage.
After Jekyll has started, go to http://127.0.0.1:4000
in a web browser.
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 /vagrant/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 /vagrant/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
/vagrant/devdocs
directory.vagrant ssh
To terminate the connection, run the command:
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
Vagrantfile
vagrant reload
-
Reload virtual machine to apply changes in
Vagrantfile
andbootstrap.sh
vagrant reload --provision
-
Reload virtual machine to apply changes in
bootstrap.sh
vagrant provision