-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
57 lines (47 loc) · 1.53 KB
/
Vagrantfile
File metadata and controls
57 lines (47 loc) · 1.53 KB
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# config.vm.box = "v0rtex/xenial64"
config.vm.box = "ubuntu/trusty64"
# Do some network configuration
config.vm.network "private_network", ip: "192.168.10.10"
# Assign a quarter of host memory and all available CPU's to VM
# Depending on host OS this has to be done differently.
config.vm.provider :virtualbox do |vb|
host = RbConfig::CONFIG['host_os']
if host =~ /darwin/
cpus = `sysctl -n hw.ncpu`.to_i
mem = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 4
elsif host =~ /linux/
cpus = `nproc`.to_i
mem = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 4
# Windows...
else
cpus = 4
mem = 2048
end
vb.customize ["modifyvm", :id, "--memory", mem]
vb.customize ["modifyvm", :id, "--cpus", cpus]
end
# Setup Development Environment
config.vm.provision :shell, :path => "bootstrap.sh"
config.vm.provision "wpcli-install",
type: "shell",
path: "wpcli.sh",
preserve_order: true
config.vm.provision "wpcli-update",
type: "shell",
inline: "wp cli update",
preserve_order: true
# Virtual Hosts - Start
config.vm.provision "example.com",
type: "shell",
path: "virtualhosts/example.com.sh",
preserve_order: true
config.vm.provision "wordpressexample.com",
type: "shell",
path: "virtualhosts/wordpressexample.com.sh",
preserve_order: true
# Virtual Hosts - End
end