vagrantfile.sh 1.82 KB
Newer Older
1
2
3
4
5
6
echo ""
echo "Writing Vagrantfile"
echo ""

cat > Vagrantfile <<EOF
Vagrant.configure("2") do |config|
7
  config.vm.box = "bento/ubuntu-16.04"
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  config.vm.hostname="${vgrthostname}"
  config.vm.network "private_network", ip: "${vgrtip}"
  ## Use NFS for shared folders for better performance
  config.vm.synced_folder '.', '/vagrant', nfs: true
  config.vm.provider :virtualbox do |virtualbox|
    virtualbox.customize ["modifyvm", :id, "--name", "${vgrthostname}"]
    virtualbox.customize ["modifyvm", :id, "--memory", "3072"]
	  virtualbox.customize ["modifyvm", :id, "--cpus", "2"]
	  virtualbox.customize ["modifyvm", :id, "--cpuexecutioncap", "80"]
  	virtualbox.customize ["modifyvm", :id, "--vram", "32"]
  end
  ## This scripts will be executed on the VM, to install things like Apache & PHP
  ## Remove the stdin is not tty error during install
    config.vm.provision :shell,
    :inline => "sed -i 's/^mesg n$/tty -s \\&\\& mesg n/g' /root/.profile"

  ## Add the variable script so we can access the variables while building the VM.
    config.vm.provision "file", source: "manifests/variable.sh", destination: "/tmp/variable.sh"
26
27
28
29

  ## Add the WCMS.crt file to the VM so the composer install command can access wms-ci-s1.
    config.vm.provision "file", source: "variables/WCMS.crt", destination: "/tmp/WCMS.crt"

30
31
32
33
34
35
36
37
  ## Provision script - run once
    config.vm.provision "shell", path: "manifests/ubuntu.sh"

  ## Copy the vhost file to default and reload apache - run every vagrant up
    config.vm.provision "shell", path: "manifests/apache.sh"

  ## Copy the drupal settings - run every vagrant up
    config.vm.provision "shell", path: "manifests/drupal.sh"
38

39
40
  ## Copy the alias files and install phpmyadmin (basically, finish installing all the things...) - run every vagrant up
    config.vm.provision "shell", path: "manifests/finish.sh"
41
42
end
EOF