forked from the-blue-alliance/the-blue-alliance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
executable file
·68 lines (58 loc) · 1.77 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- mode: ruby -*-
# vi: set ft=ruby:expandtab:tabstop=2:softtabstop=2
Vagrant.require_version "> 2.1.0"
Vagrant.configure("2") do |config|
# Sync the TBA code directory
config.vm.synced_folder "./", "/tba",
type: "rsync",
owner: "root",
group: "root",
rsync__rsync_path: "rsync",
rsync__exclude: [
".git/",
"node_modules/",
"lib/",
"static/compiled/",
],
rsync__auto: true
# Forward GAE modules
ports = []
for i in 8080..8089
ports.push("#{i}:#{i}")
config.vm.network "forwarded_port", guest: i, host: i
end
# Forward GAE admin
ports.push("8000:8000")
config.vm.network "forwarded_port", guest: 8000, host: 8000
# Provision with docker
config.vm.hostname = "tba-docker"
config.vm.provider "docker" do |d|
d.name = "tba"
d.build_dir = "ops/dev"
d.ports = ports
d.has_ssh = true
end
# Configure ssh into container
config.ssh.insert_key = true
config.ssh.username = "root"
config.ssh.password = "tba"
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
# Provision dependencies
config.vm.provision "shell",
inline: "cd /tba && ./ops/dev/bootstrap-dev-container.sh",
privileged: false
# Load in the datastore file, needs to run before devserver start
config.vm.provision "shell",
inline: "cd /tba && ./ops/dev/pull-datastore.sh push",
privileged: false
# Start the GAE devserver
config.vm.provision "shell",
inline: "cd /tba && ./ops/dev/start-devserver.sh",
privileged: false,
run: "always"
# When the container halts, pull the datastore files
config.trigger.before [:halt, :destroy] do |trigger|
trigger.info = "Pulling datastore from remote container"
trigger.run = {inline: "./ops/dev/pull-datastore.sh pull"}
end
end