-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
53 lines (42 loc) · 1.63 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
#config.ssh.username = "vagrant"
#config.ssh.password = "vagrant"
# Host name of the VM
config.vm.hostname = "craft.local"
# Box Settings
config.vm.box = "ubuntu/xenial64"
# Provider Settings
config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
# Network Settings
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.network :forwarded_port, guest: 3000, host: 3000, auto_correct: true
config.vm.network :forwarded_port, guest: 3001, host: 3001, auto_correct: true
config.vm.network :forwarded_port, guest: 3306, host: 3306, auto_correct: true
# Folder Settings
config.vm.synced_folder "./www", "/var/www", :nfs => { :mount_options => ["dmode=777", "fmode=666"] }
config.vm.provision "shell", path: "bootstrap.sh"
config.vm.provision "shell",
inline: "mysql -uroot -proot -e \"SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));\"",
run: "always"
if Vagrant.has_plugin?('vagrant-hostmanager')
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.hostmanager.aliases = %w(craft.local)
end
config.trigger.after :up do |trigger|
trigger.info = "Restoring database..."
trigger.run_remote = {path: "./resources/importdb.sh"}
end
config.trigger.before :halt do |trigger|
trigger.info = "Dumping the database before shutting down..."
trigger.run_remote = {path: "./resources/exportdb.sh"}
end
end