Skip to content

Commit

Permalink
Use homestead for vm
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Pinxteren committed Aug 1, 2019
1 parent debc3fd commit f8a907d
Show file tree
Hide file tree
Showing 18 changed files with 906 additions and 1,808 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#################
vagrant.retry
.vagrant
homestead/vendor

# Code coverage reports #
#################
Expand All @@ -16,7 +17,7 @@ vagrant.retry
.DS_Store
.DS_Store?


# Application files #
######################
/vendor/
composer.lock
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,15 @@ from that machine.
Requirements
-------------------
- ansible 2.x
- vagrant 1.9.x
- ansible 2.6.x
- vagrant 2.2.x
- vagrant-hostsupdater (1.1.1.160, global)
- vagrant-vbguest (0.19.0, global)
- Virtualbox
Install
-------------------
``` cd homestead && composer install ```

``` vagrant up ```

Expand Down
67 changes: 49 additions & 18 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,50 @@
Vagrant.configure(2) do |config|
config.vm.box = "CentOS-7.0"
config.vm.box_url = "https://build.openconext.org/vagrant_boxes/virtualbox-centos7.box"

config.vm.network "private_network", ip: "192.168.77.43"
config.vm.synced_folder ".", "/vagrant", :nfs => true, type: "nfs"

config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", "1024"]
end

config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/vagrant.yml"
ansible.groups = {"dev" => "default"}
ansible.extra_vars = {
develop_spd: true
}
end
# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("homestead/vendor/laravel/homestead", File.dirname(__FILE__))

homesteadYamlPath = File.expand_path("homestead/Homestead.yaml", File.dirname(__FILE__))
homesteadJsonPath = File.expand_path("homestead/Homestead.json", File.dirname(__FILE__))
afterScriptPath = "homestead/after.sh"
customizationScriptPath = "homestead/user-customizations.sh"
aliasesPath = "homestead/aliases"

require File.expand_path(confDir + '/scripts/homestead.rb')

Vagrant.require_version '>= 1.9.0'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.boot_timeout = 600
if File.exist? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
config.vm.provision "shell" do |s|
s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases"
end
end

if File.exist? homesteadYamlPath then
settings = YAML::load(File.read(homesteadYamlPath))
elsif File.exist? homesteadJsonPath then
settings = JSON.parse(File.read(homesteadJsonPath))
else
abort "Homestead settings file not found in #{confDir}"
end

Homestead.configure(config, settings)

if File.exist? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true
end

if File.exist? customizationScriptPath then
config.vm.provision "shell", path: customizationScriptPath, privileged: false, keep_color: true
end

if defined? VagrantPlugins::HostsUpdater
config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
end
end
62 changes: 0 additions & 62 deletions ansible/files/remi.repo

This file was deleted.

13 changes: 0 additions & 13 deletions ansible/files/xdebug.ini

This file was deleted.

35 changes: 0 additions & 35 deletions ansible/tasks/main.yml

This file was deleted.

Loading

0 comments on commit f8a907d

Please sign in to comment.