forked from jacksingleton/hacker-slides
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
50 lines (40 loc) · 1.85 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
39
40
41
42
43
44
45
46
47
48
49
50
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# We base ourselves off the trusty (Ubuntu 14.04) base box.
config.vm.box = "trusty64"
# The url from which to fetch that base box.
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
# We forward port 6080, the Sandstorm web port, so that developers can
# visit their sandstorm app from their browser as local.sandstorm.io:6080
# (aka 127.0.0.1:6080).
config.vm.network :forwarded_port, guest: 6080, host: 6080
# Forward all of 7000-7100, since these are used for hosting apps.
$port = 7000
while $port <= 7100 do
config.vm.network :forwarded_port, guest: $port, host: $port
$port += 1
end
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
config.vm.network :public_network
# Use a shell script to "provision" the box. This install Sandstorm using
# the bundled installer.
config.vm.provision "shell",
inline: "cd /vagrant && echo localhost > /etc/hostname && hostname localhost && sudo ./infra/install-sandstorm.sh -d -e"
# Make the vagrant user part of the sandstorm group so that commands like
# `spk dev` work
config.vm.provision "shell", inline: "usermod -a -G 'sandstorm' 'vagrant'"
config.vm.provision "shell", inline: <<-EOF
sudo apt-get install -y python3-pip
pip3 install -r /vagrant/requirements.txt
sudo cp /vagrant/initial-slides.md /var/slides.md && sudo chmod 777 /var/slides.md
echo "To start hacker slides in dev mode:"
echo "'vagrant ssh'"
echo "'cd /vagrant'"
echo "'spk dev'"
EOF
end