Test Devilry locally with Vagrant

You can deploy a complete Devilry demo in a local VirtualBox machine with just a couple of commands.

Install VirtualBox and Vagrant

See the Vagrant website. The getting started guide explains about VirtualBox and where to download it.

Get the sources

Clone the sources for devilry-deploy. You find them at our GitHub project page

Create a vagrant box

$ cd vagrant/demoserver/
$ vagrant up

When the box is up, you can visit Devilry at http://localhost:9090. Login with one of:

- ``thor`` (student, examiner and courseadmin) - Since the current release is focused on the subject admin UI, this is probably the user you want to be using.
- ``dewey`` (student) - Use this instead of thor if you really want to test the student UI.
- ``donald`` (examiner)
- ``grandma`` (superuser)

or go to http://localhost:9090/devilry_sandbox/createsubject-intro.

Load a dump

To load a postgresql dump instead of setting up the demodb, add "recipe[django_postgresql::load_dump]" to chef/roles/demoserver.json, right after django_postgresql. I.E:

...
"recipe[django_postgresql]",
"recipe[django_postgresql::load_dump]",
"recipe[devilryprodenv]",
...

To avoid that the loaded database dump is poluted by autogenerated data, you must also remove recipe[devilry_minimal_autodb]" and/or "recipe[devilrydemo]".

The database must be placed in dbdump.postgres.sql in the same directory as Vagrantfile (I.E.: It should be available as /vagrant/dbdump.postgres.sql to the Vagrant VM).

Note

Does your database dumps create a database?

The load_dump recipe creates a database for you, so please remove/comment out any create database and change database owner lines in your dump. They look like this:

CREATE DATABASE devilry_prod WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'C' LC_CTYPE = 'nb_NO.UTF8';

ALTER DATABASE devilry_prod OWNER TO devilry;

Tips

Take a Database dump

$ vagrant ssh
$ sudo -u postgres pg_dump djangodb > /vagrant/mydump.sql

NOTE: You should write the dump to dbdump.postgres.sql if you want to restore/load it as described above.

Tired of waiting?

Re-provisioning a lot, and tired of waiting for dev_autodb? Edit chef/roles/demoserver.json and change recipe[devilrydemo] to recipe[devilry_minimal_autodb]. devilry_minimal_autodb runs dev_autodb --no-groups, which means that the testdatabase will not have any students/groups registered on the assignments. Just make sure you do not commit this change. You may also consider loading a dump as described above.

Test Trix with Vagrant

To deploy the devilry-subproject Trix, follow the instructions above, but use vagrant/trixtest/ instead of vagrant/demoserver/. Trixtest runs on http://localhost:9091, so you can safely run both devilrydemo and trixtest at the same time.

The JSON config file for the role used by the Trix vagrant config is chef/roles/trixtest.json.

See also

Build Trix.