-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
62 lines (53 loc) · 2.75 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/bionic64"
# Environment definitions using Vagrant multi-machine features.
# To add an environment:
# - Add a define block with the name and hostname of the environment
# - Assign an unused IP to the environment. IP's in this file are based
# on the default VirtualBox private network.
# - Add a conditional to copy ./.${ENV}rc to ~/.deploymentrc on the VM.
# Environment-specific configuration is stored in this file. The file is
# not tracked, so the conditional is necessary to avoid errors checkouts
# without an rc.
# - (optional) Add a line to /etc/hosts mapping the env IP to its hostname.
# this allows accessing the env locally by its hostname rather than IP.
# - (optional) Copy ./.example-envrc to ./.${ENV}rc and modify as needed.
#
# Specific environments can be controlled using ./run-host stack $ENV ...
config.vm.define "dev", primary: true do |dev|
dev.vm.network "private_network", ip: "172.28.128.10"
dev.vm.hostname = "share-space-dev"
if (File.file?(".devrc"))
dev.vm.provision ".devrc", type: "file", source: ".devrc", destination: "~/.deploymentrc"
end
end
config.vm.define "staging", primary: true do |dev|
dev.vm.network "private_network", ip: "172.28.128.12"
dev.vm.hostname = "share-space-staging"
if (File.file?(".stagingrc"))
dev.vm.provision ".stagingrc", type: "file", source: ".stagingrc", destination: "~/.deploymentrc"
end
end
config.vm.define "prod", autostart: false do |prod|
prod.vm.network "private_network", ip: "172.28.128.11"
prod.vm.hostname = "share-space-prod"
if (File.file?(".prodrc"))
prod.vm.provision ".prodrc", type: "file", source: ".prodrc", destination: "~/.deploymentrc"
end
end
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "site", "/home/vagrant/site", create: true
config.vm.provider "virtualbox" do |vb|
vb.memory = "8096"
vb.cpus = 8
end
config.vm.provision "stack-install", type: "shell", privileged: false, path: "run-env", args: "stack-install"
# Do not run any of these on up, only with vagrant provision,
# since the deploymentrc is loaded last on up
config.vm.provision "stack-build", type: "shell", privileged: false, run: "never", path: "run-env", args: "stack-build"
config.vm.provision "stack-up", type: "shell", privileged: false, run: "never", path: "run-env", args: "stack-up"
config.vm.provision "stack-down", type: "shell", privileged: false, run: "never", path: "run-env", args: "stack-down"
config.vm.provision "stack-status", type: "shell", privileged: false, run: "never", path: "run-env", args: "stack-status"
end