The host: Your machine made out of metal and plastic and stuff. It runs Windows.
The VM: The Linux (CentOS) computer running inside your host machine.
vagrant
: The software we're using to manage the VM. Run vagrant
commands in the git bash
window in your host computer.
docker and docker-compose
: The software we're using to run the WordPress
site. Run docker
commands inside the Window in your VM.
tmux
: A terminal multiplexer. This runs inside the VM. We're using it to
save our session between work sessions. It will also allow us to start things
running and then forget about them.
Xvfb: A windowing system without any display.
To start up the vagrant VM. You'll do this in a git bash
window at the
beginning of each work session.
vagrant up
To log into the VM from a git bash
window (after running 'vagrant up').
vagrant ssh
To get back to a running tmux session after logging into the VM.
tmux attach
If it complains that there's no tmux sessions, skip down to Setting up a Session below, and then come back here.
Now, to run tests, from within tmux. (You can also run a specific spec file
by passing it in as a full path name in place of specs/
below.)
xvfb-run ./rs specs/
Now, when you're done, you first need to detach from tmux. Do this by
pressing <Ctrl-b d>
.
Now, you're in the VM. Exit from the VM by pressing <Ctrl-d>
.
Finally, you can suspend the VM.
vagrant suspend
You'll need to get the various servers running again. To do that, follow these instructions:
-
Change into the Ivanhoe directory:
cd /vagrant/wordpress/wp-content/themes/ivanhoe
-
Start tmux
tmux
- We'll be creating new windows within this tmux session. First create a session with
<Ctrl-b c>
. Now start Xvfb.
Xvfb
- Create another session with
<Ctrl-b c>
. Now start the docker server and start the wordpress site and database.
sudo service docker start
docker-compose start
- Change back to the original tmux window with
<Ctrl-b 0>
. Now everything's running again, and you can go back to the previous instructions.