forked from oppia/oppia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
38 lines (33 loc) · 1.51 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
# The recommended method for short, multi-line shell scripts in Vagrant.
# Usage: http://stackoverflow.com/questions/2500436/how-does-cat-eof-work-in-bash
$env_script = <<SCRIPT
# General-purpose env var to let scripts know we are in Vagrant.
echo "export VAGRANT=true" >> /etc/profile
# Create file (if it does not exist already) to let scripts know we are in Vagrant.
touch /etc/is_vagrant_vm
SCRIPT
$script = <<SCRIPT
cd /home/vagrant/oppia
bash ./scripts/install_prerequisites.sh
bash ./scripts/start.sh
SCRIPT
Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |v|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
v.memory = 2048
end
config.vm.provision "shell", inline: $env_script
# Tell apt to default to "yes" when installing packages. Necessary for unattended installs.
config.vm.provision "shell", inline: 'echo \'APT::Get::Assume-Yes "true";\' > /etc/apt/apt.conf.d/90yes'
config.vm.network "forwarded_port", guest: 8000, host: 8000, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 8181, host: 8181, host_ip: "127.0.0.1"
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/home/vagrant/oppia"
config.vm.provision "shell", inline: $script
end