-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
104 lines (75 loc) · 2.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Ensure a minimum Vagrant version to prevent potential issues.
Vagrant.require_version '>= 1.5.0'
# Configure using Vagrant's version 2 API/syntax.
Vagrant.configure(2) do |config|
# Ubuntu 14.04, 64 bit
config.vm.box = 'ubuntu/trusty64'
config.vm.box_version = '~> 14.04'
config.vm.synced_folder '.', '/vagrant', disabled: true
# Providers
config.vm.provider :virtualbox do |v|
v.customize ['modifyvm', :id, '--memory', '512', '--ioapic', 'on']
end
# SSH
config.ssh.username = 'vagrant'
# Port Forwarding
config.vm.network :forwarded_port, guest: 8080, host: 8080
config.vm.network :forwarded_port, guest: 28015, host: 28015
config.vm.network :forwarded_port, guest: 29015, host: 29015
config.vm.network :forwarded_port, guest: 8081, host: 8081
config.vm.network :forwarded_port, guest: 3000, host: 3000
# Provisioning
config.vm.provision "install-rethinkdb", type: "shell" do |sh|
sh.inline = <<-EOF
# Install RethinkDB
source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
sudo apt-get --assume-yes update
sudo apt-get install --assume-yes rethinkdb;
EOF
end
config.vm.provision "run-rethinkdb", type: "shell" do |sh|
sh.inline = <<-EOF
# Creating the default.conf for RethinkDB so it can start as a service
sed -e 's/# bind=127.0.0.1/bind=all/g' /etc/rethinkdb/default.conf.sample > /etc/rethinkdb/instances.d/default.conf;
# Start RethinkDB
service rethinkdb start;
EOF
end
config.vm.provision "install-git", type: "shell" do |sh|
sh.inline = <<-EOF
# Install Git
sudo apt-get -y install git;
EOF
end
config.vm.provision "install-node", type: "shell" do |sh|
sh.inline = <<-EOF
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -;
sudo apt-get install --yes nodejs;
sudo npm install -g webpack-dev-server;
sudo npm install -g babel;
EOF
end
config.vm.provision "install-npm-packages", type: "shell" do |sh|
sh.inline = <<-EOF
sudo npm install -g webpack-dev-server;
sudo npm install -g babel;
EOF
end
config.vm.provision "install-gearz", type: "shell" do |sh|
sh.inline = <<-EOF
sudo git clone https://github.com/gearz-lab/gearz.git;
cd /home/vagrant/gearz;
sudo npm install;
EOF
end
config.vm.provision "run-gearz", type: "shell" do |sh|
sh.inline = <<-EOF
cd /home/vagrant/gearz;
sudo git pull;
sudo npm run wpds;
EOF
end
end