|
1 | 1 | # -*- mode: ruby -*-
|
2 | 2 | # vi: set ft=ruby :
|
3 | 3 |
|
4 |
| -Vagrant::Config.run do |config| |
5 |
| - # All Vagrant configuration is done here. The most common configuration |
6 |
| - # options are documented and commented below. For a complete reference, |
7 |
| - # please see the online documentation at vagrantup.com. |
8 | 4 |
|
9 |
| - # Every Vagrant virtual environment requires a box to build off of. |
10 |
| - config.vm.box = "lucid32" |
| 5 | +# Inline provisioning shell script |
| 6 | +@script = <<SCRIPT |
11 | 7 |
|
12 |
| - # The url from where the 'config.vm.box' box will be fetched if it |
13 |
| - # doesn't already exist on the user's system. |
14 |
| - config.vm.box_url = "http://files.vagrantup.com/lucid32.box" |
| 8 | +echo -e '\nexport PATH=~/.composer/vendor/bin:$PATH\n' >> ~/.bashrc |
15 | 9 |
|
16 |
| - # Boot with a GUI so you can see the screen. (Default is headless) |
17 |
| - #config.vm.boot_mode = :gui |
| 10 | +# Switch to PHP7 |
| 11 | +newphp 7 |
18 | 12 |
|
19 |
| - # Assign this VM to a host-only network IP, allowing you to access it |
20 |
| - # via the IP. Host-only networks can talk to the host machine as well as |
21 |
| - # any other machines on the same network, but cannot be accessed (through this |
22 |
| - # network interface) by any external networks. |
23 |
| - # config.vm.network :hostonly, "192.168.33.10" |
| 13 | +# rebuild PHP7 |
| 14 | +#makephp 7 |
24 | 15 |
|
25 |
| - # Assign this VM to a bridged network, allowing you to connect directly to a |
26 |
| - # network using the host's network device. This makes the VM appear as another |
27 |
| - # physical device on your network. |
28 |
| - # config.vm.network :bridged |
| 16 | +echo "" |
| 17 | +echo "** SSH into the box to run the tests. use newphp to switch between versions and makephp 7 to rebuld PHP 7**" |
| 18 | +echo "** Use 'newphp nn' to switch between versions (e.g. newphp 54)**" |
| 19 | +echo "** Install PHPUnit via composer global require phpunit/phpunit:~n.n for the version required**" |
| 20 | +echo "" |
| 21 | +SCRIPT |
29 | 22 |
|
30 |
| - # Forward a port from the guest to the host, which allows for outside |
31 |
| - # computers to access the VM, whereas host only networking does not. |
32 |
| - config.vm.forward_port 80, 8081 |
33 | 23 |
|
34 |
| - # Hostname |
35 |
| - config.vm.host_name = "zf1.dev" |
| 24 | +# Vagrant configuration |
| 25 | +VAGRANTFILE_API_VERSION = "2" |
| 26 | +Vagrant.configure(VAGRANTFILE_API_VERSION) do |c| |
| 27 | + c.vm.define "zf1dev", primary: true do |config| |
| 28 | + config.vm.box = 'rasmus/php7dev' |
| 29 | + # config.vm.network :forwarded_port, guest: 80, host: 8889 |
| 30 | + config.vm.hostname = "zf1dev.localhost" |
| 31 | + |
| 32 | + config.vm.provision 'shell', inline: @script |
36 | 33 |
|
37 |
| - # Pass custom arguments to VBoxManage before booting VM |
38 |
| - config.vm.customize [ |
39 |
| - # 'modifyvm', :id, '--chipset', 'ich9', # solves kernel panic issue on some host machines |
40 |
| - # '--uartmode1', 'file', 'C:\\base6-console.log' # uncomment to change log location on Windows |
41 |
| - "setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1" |
42 |
| - ] |
| 34 | + config.vm.provider "virtualbox" do |vb| |
| 35 | + vb.customize ["modifyvm", :id, "--memory", "1024"] |
| 36 | + end |
43 | 37 |
|
44 |
| - # Share an additional folder to the guest VM. The first argument is |
45 |
| - # an identifier, the second is the path on the guest to mount the |
46 |
| - # folder, and the third is the path on the host to the actual folder. |
47 |
| - # config.vm.share_folder "v-data", "/vagrant_data", "../data" |
48 |
| - |
49 |
| - # Enable provisioning with Puppet stand alone. Puppet manifests |
50 |
| - # are contained in a directory path relative to this Vagrantfile. |
51 |
| - # You will need to create the manifests directory and a manifest in |
52 |
| - # the file lucid32.pp in the manifests_path directory. |
53 |
| - # |
54 |
| - # An example Puppet manifest to provision the message of the day: |
55 |
| - # |
56 |
| - # # group { "puppet": |
57 |
| - # # ensure => "present", |
58 |
| - # # } |
59 |
| - # # |
60 |
| - # # File { owner => 0, group => 0, mode => 0644 } |
61 |
| - # # |
62 |
| - # # file { '/etc/motd': |
63 |
| - # # content => "Welcome to your Vagrant-built virtual machine! |
64 |
| - # # Managed by Puppet.\n" |
65 |
| - # # } |
66 |
| - # |
67 |
| - # config.vm.provision :puppet do |puppet| |
68 |
| - # puppet.manifests_path = "manifests" |
69 |
| - # puppet.manifest_file = "lucid32.pp" |
70 |
| - # end |
71 |
| - |
72 |
| - |
73 |
| - config.vm.provision :puppet do |puppet| |
74 |
| - puppet.manifests_path = "puppet/manifests" |
75 |
| - puppet.manifest_file = "default.pp" |
76 | 38 | end
|
| 39 | +end |
77 | 40 |
|
78 |
| -# config.vm.provision :puppet do |puppet| |
79 |
| -# puppet.manifests_path = "puppet/manifests" |
80 |
| -# puppet.module_path = "puppet/modules" |
81 |
| -# puppet.manifest_file = "zf1.pp" |
82 |
| -# puppet.options = [ |
83 |
| -# '--verbose', |
84 |
| -# #'--debug', |
85 |
| -# # '--graph', |
86 |
| -# # '--graphdir=/vagrant/puppet/graphs' |
87 |
| -# ] |
88 |
| -# end |
89 | 41 |
|
90 |
| -end |
| 42 | + # config.vm.customize [ |
| 43 | + # # 'modifyvm', :id, '--chipset', 'ich9', # solves kernel panic issue on some host machines |
| 44 | + # # '--uartmode1', 'file', 'C:\\base6-console.log' # uncomment to change log location on Windows |
| 45 | + # "setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1" |
| 46 | + # ] |
0 commit comments