Run provision.py as a provisioner.

This way, vagrant up for the first time will set up the developer's VM
correctly

(imported from commit cee17b15e2f53a1b6de1f1ee16dbad00071ba55c)
This commit is contained in:
Luke Faraone 2015-08-18 19:14:50 -07:00 committed by Tim Abbott
parent e2d416ad8b
commit 0d7f749ad8
2 changed files with 14 additions and 19 deletions

View File

@ -6,29 +6,12 @@ Using Vagrant
This is the recommended approach, and is tested on OS X 10.10 as well as Ubuntu 14.04.
If your host is OS X, download VirtualBox from <http://download.virtualbox.org/virtualbox/4.3.30/VirtualBox-4.3.30-101610-OSX.dmg>. Then run:
vagrant up
vagrant ssh
If your host is OS X, download VirtualBox from <http://download.virtualbox.org/virtualbox/4.3.30/VirtualBox-4.3.30-101610-OSX.dmg>.
If your host is Ubuntu 14.04:
sudo apt-get install vagrant lxc lxc-templates cgroup-lite redir
vagrant plugin install vagrant-lxc
vagrant up --provider=lxc
vagrant ssh
All versions, inside the container:
sudo apt-get update
sudo apt-get install python-pbs
cd /srv/zulip && python provision.py
To run the development server:
vagrant ssh -- -L9991:localhost:9991
# Now inside the container
cd /srv/zulip
source /srv/zulip-venv/bin/activate
./tools/run-dev.py
You can now visit <http://localhost:9991/> in your browser.
Once that's done, simply run `vagrant up`. Congrats, you can now visit <http://localhost:9991/> in your browser.
By hand
-------

12
Vagrantfile vendored
View File

@ -19,4 +19,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.memory = 2048
end
$provision_script = <<SCRIPT
set -x
set -e
sudo apt-get update
sudo apt-get install -y python-pbs
python /srv/zulip/provision.py
SCRIPT
config.vm.provision "shell",
# We want provision.py to be run with the permissions of the vagrant user.
privileged: false,
inline: $provision_script
end