This is a working example of using Rake, Vagrant, and the Scholars' Lab's Chef cookbook to create a working development environment for a site based on Omeka and Solr.
This requires this software to get started:
This provides a set of Rake tasks to manage the Vagrant-managed VM.
In order for this to work, you'll need to set the passwords specified in the
Vagrantfile
. For most of you, this will be impossible, since you don't have
any access to the resources mentioned. However, this should still provide a
good example of setting up a system like this.
You'll also need the content for the site, provided by a database dump and a
tarball of static files. In the Rakefile
, these are named
falmouth-production.sql.gz
and archive.tar.bz2
. It will run successfully
without these, but the database won't be populated, and the you'll need to
remove the init
task's dependencies on setup:loaddb
and setup:archive
.
Basically, you'll use this by putting the Vagrantfile
and Rakefile
into a
directory and calling:
$ rake init
Once it's done, you need to finish upgrading Omeka and trigger recreating the Solr index. To do this, follow these steps:
/solr/
.That's it. You can access the web site at http://localhost:8050/.
First, the init
task clones the Chef cookbooks it needs from GitHub.
Then it initializes the VM. This sets up Omeka and Solr. This also downloads the Falmouth Omeka theme and the CsvImport, SolrSearch, VraCoreElementSet, and Dropbox plugins. Finally, it loads the data (the database dump and the static file archive) and configures Solr.
The Rakefile
has a number of useful tasks.
This pulls down all the data it can and sets up the site. This should only need to be called once.
This removes everything that the init
task set up. This destroys the VM and
removes the two GitHub repositories it downloaded.
Sometimes, Chef has problems setting things up, and it leaves a stacktrace file on the VM. This makes a SSH call to cat the file to the terminal.
This does a graceful shutdown of the VM. This is better than calling vagrant halt
, which does a hard shut-down.