Meza/Emulate the Travis CI test setup
< Meza
Initial setup edit
Do initial setup of a Meza Vagrant box:
- Get VirtualBox, Vagrant, and Git
- Git-clone Meza and
cd
into the Meza directory vagrant up
- So it's easy to revert, take a snapshot called "vagrantup":
vagrant snapshot save vagrantup
vagrant ssh
sudo meza setup docker
Running tests edit
To run the same tests as are run on Travis CI for each Meza commit, do the following:
TEST_TYPE="insert test type from below"
sudo /opt/meza/tests/docker/run-tests.sh "$TEST_TYPE"
Replace insert test type from below
with one of the test types below:
monolith-from-scratch
: Installs meza on a single servermonolith-from-import
: Installs meza on a single server from backup filesimport-from-remote
: Installs meza on a single server, pulling data from a remote meza serverbackup-to-remote
: Runs backup to a remote serverimport-from-alt-remote
: Installs meza on a single server, pulling data from a non-standard setup
SSH into the Docker container edit
To SSH into the Docker container (which may be frowned upon by the Docker community):
- Figure out the container ID using
sudo docker ps
- For convenience, set
container_id=<whatever your container id is>
- Set the root password for the container to 1234 (this is just for dev purposes):
sudo docker exec "$container_id" bash -c "echo root:1234 | chpasswd"
- Figure out your containers IP address:
sudo docker inspect -f 'Template:Range .NetworkSettings.NetworksTemplate:.IPAddressTemplate:End' $container_id
- Login:
ssh root@IP_ADDRESS_FROM_PREVIOUS_STEP
.
After figuring out what your container ID is (via sudo docker ps
), do the rest in one copy-paste:
container_id=ctrl
sudo docker exec "$container_id" bash -c "echo root:1234 | chpasswd"
ip_addr=$(sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container_id)
echo $ip_addr
ssh root@$ip_addr
Running a new test edit
Unfortunately at this point the best way to start a new test is to exit your Vagrant machine (just type exit
) then restore the snapshot you created with vagrant snapshot restore vagrantup
and rerun the steps.