-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
100 lines (85 loc) · 3.12 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANT_API_VERSION = "2"
PROJECT = 'vagrant'
MYSQL_DB_NAME='vagrant'
MYSQL_USER='root'
MYSQL_PASSWORD=''
TLD='local'
EMAIL='joaocosta.azores@gmail.com'
GITNAME='João Costa'
VAGRANT_HOME='/home/vagrant'
INSTALL_NGINX_INSTEAD=0
INSTALL_POSTGRESQL=0
INSTALL_SQLITE=0
INSTALL_MONGODB=0
INSTALL_BEANSTALKD=0
INSTALL_WPCLI=0
INSTALL_DRUSH=0
INSTALL_NGROK=0
INSTALL_NODEJS=0
INSTALL_YARN=0
INSTALL_RUBY=0
INSTALL_REDIS=0
INSTALL_MEMCACHED=0
INSTALL_GOLANG=0
INSTALL_MAILHOG=0
INSTALL_OCTOBERCMS=1
XDEBUG_KEY=PROJECT + 'IDEKEY'
GUEST_HOSTNAME = PROJECT + "." + TLD
GUEST_NETWORK_IP = "192.168.59.80"
GUEST_MEMORY_LIMIT = "1024"
GUEST_CPU_LIMIT = "1"
GUEST_DIRECTORY = "/var/www/" + PROJECT
ARGS = {
"PROJECT" => PROJECT,
"MYSQL_PASSWORD" => MYSQL_PASSWORD,
"MYSQL_DB_NAME" => MYSQL_DB_NAME,
"MYSQL_USER" => MYSQL_USER,
"EMAIL" => EMAIL,
"GITNAME" => GITNAME,
"GUEST_HOSTNAME" => GUEST_HOSTNAME,
"GUEST_NETWORK_IP" => GUEST_NETWORK_IP,
"GUEST_DIRECTORY" => GUEST_DIRECTORY,
"VAGRANT_HOME" => VAGRANT_HOME,
"INSTALL_NGINX_INSTEAD" => INSTALL_NGINX_INSTEAD,
"INSTALL_POSTGRESQL" => INSTALL_POSTGRESQL,
"INSTALL_SQLITE" => INSTALL_SQLITE,
"INSTALL_MONGODB" => INSTALL_MONGODB,
"INSTALL_BEANSTALKD" => INSTALL_BEANSTALKD,
"INSTALL_WPCLI" => INSTALL_WPCLI,
"INSTALL_NGROK" => INSTALL_NGROK,
"INSTALL_NODEJS" => INSTALL_NODEJS,
"INSTALL_YARN" => INSTALL_YARN,
"INSTALL_RUBY" => INSTALL_RUBY,
"INSTALL_REDIS" => INSTALL_REDIS,
"INSTALL_MEMCACHED" => INSTALL_MEMCACHED,
"INSTALL_GOLANG" => INSTALL_GOLANG,
"INSTALL_MAILHOG" => INSTALL_MAILHOG,
"INSTALL_OCTOBERCMS" => INSTALL_OCTOBERCMS,
"XDEBUG_KEY" => XDEBUG_KEY
}
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = GUEST_HOSTNAME
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: GUEST_NETWORK_IP
# Allow more memory usage for the VM
config.vm.provider :virtualbox do |v|
v.memory = GUEST_MEMORY_LIMIT
v.cpus = GUEST_CPU_LIMIT
v.name = GUEST_HOSTNAME
end
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
# forward agent for ansible access
config.ssh.forward_agent = true
config.ssh.insert_key = false
config.vm.provision "shell", path: "install/core.sh", privileged: false, env: ARGS
config.vm.provision "shell", path: "install/apache.sh", privileged: false, env: ARGS
config.vm.provision "shell", path: "install/nginx.sh", privileged: false, env: ARGS
config.vm.provision "shell", path: "install/php.sh", privileged: false, env: ARGS
config.vm.provision "shell", path: "install/database.sh", privileged: false, env: ARGS
config.vm.provision "shell", path: "install/extras.sh", privileged: false, env: ARGS
config.vm.provision "shell", path: "install/end.sh", privileged: false, env: ARGS
#config.vm.provision "shell", path: "install.sh", privileged: false
end