edx/edx-platform — pull request #102 by antoviaque (2013-06-07 11:10:30+00:00)
Title: Vagrant: Add support for Vagrant install (`vagrant up`)

This adds support to install and setup a dev instance through Vagrant. The Vagrantfile at the root handles the vagrant commands like `vagrant up`.

Provisioning is done by the shell script `vagrant-provisionning.sh`, which is a light wrapper around the `create-dev-setup.sh` which does most of the job using the standard process, but limiting possible side-effect by ensuring the environment on which the install is performed is clean.

Based on an Ubuntu precise 12.04 LTS. See details in the README on how to use.

Other fixes included with this patch, which were necessary to either fix issues with the current install script, or allow it to complete in the context of Vagrant shell provisioning:
* Fix install script freeze (syncdb superuser account creation): Since the output is passed through tee, when the django admin asks the user if he would like to create a super user account, it blocks the install, without even showing the question. Disabled interactivity for syncdb.
* Fix use of DEBIAN_FRONTEND: Before executing a command, for security reasons `sudo` clears the environment, so the value of DEBIAN_FRONTEND was never passed to apt-get. This was causing the mysql packqge to still prompt for a value interactively.
* Improves ruby/rvm install by directly installing the right version: The script used to download the latest version of ruby through rvm, then later on install the one used by the project. Now we directly download the version of the project when rvm is installed.
* Options "-q" (quiet), "-n" (no pull), "-y" (non interactive): Added several options to the `create-dev-env.sh` script to improve its ability to be used by another script:
** -y -- non interactive mode (no prompt, proceed immediately)
** -n -- do not attempt to pull edx-platform
** -q -- be more quiet (removes info at beginning & end)
* Make curl options more consistent, add logging of errors: The options passed to curl were not always the same - added logging of error (-S) everywhere (was only used for Mac before) and made it quiet in the rare few cases where it wasn't yet (-s).
* Make `apt-get` and `mkvirtualenv` output log friendly: Added options to make the output of `apt-get` and `mkvirtualenv` friendlier to getting logged. This allows to be more easily recorded in log files or when the install is performed through utilities - like Vagrant.
* Also included "create-dev-env.sh: if run from repo, set $BASE appropriately" from Yarko - cf https://github.com/edx/edx-platform/pull/32