This repository was archived by the owner on Oct 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathVagrantfile
executable file
·61 lines (52 loc) · 1.97 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
module OS
def OS.is_windows
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
end
require 'pathname.rb'
host_magento_dir = Pathname.new(Dir.pwd + '/magento2ce').realpath.to_s
magento_host_name = 'magento2.vagrant'
magento_ip_address = '192.168.10.11'
VAGRANT_API_VERSION = 2
Vagrant.configure(VAGRANT_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.memory = 3072 # Around 3Gb is necessary to be able to run tests
end
config.vm.synced_folder '.', '/vagrant'
if OS.is_windows
guest_magento_dir = '/var/www/magento2ce'
config.vm.synced_folder host_magento_dir + '/var/generation', guest_magento_dir + '/var/generation'
config.vm.synced_folder host_magento_dir + '/app/etc', guest_magento_dir + '/app/etc'
else
guest_magento_dir = host_magento_dir
config.vm.synced_folder host_magento_dir, guest_magento_dir, type: "nfs"
end
shell_script_args = [
OS.is_windows ? "1" : "0",
guest_magento_dir,
magento_host_name
]
config.vm.provision "install_environment", type: "shell" do |s|
s.path = "scripts/provision/install_environment.sh"
s.args = shell_script_args
end
if OS.is_windows
config.vm.provision "deploy_magento_code", type: "file", source: host_magento_dir, destination: '/var/www'
end
config.vm.provision "install_magento", type: "shell" do |s|
s.path = "scripts/provision/install_magento.sh"
s.args = shell_script_args
end
# Host manager plugin configuration
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.vm.define magento_host_name do |node|
node.vm.hostname = magento_host_name
node.vm.network :private_network, ip: magento_ip_address
end
end