Skip to content

Commit

Permalink
Add laravel/homestead box and remove puppet scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmackay committed Apr 27, 2017
1 parent d928d0d commit 66a27ef
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 247 deletions.
27 changes: 27 additions & 0 deletions Homestead.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ip: 192.168.33.110
memory: 1024
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
-
map: "./"
to: /vagrant
type: "nfs"
-
map: "./"
to: /home/vagrant/Code/platform-api
type: "nfs"
sites:
-
map: api.ushahidi.app
to: /home/vagrant/Code/platform-api/httpdocs
-
map: ushv3.dev
to: /home/vagrant/Code/platform-api/httpdocs
databases:
- ushahidi
name: platform-api
hostname: platform-api
6 changes: 0 additions & 6 deletions Puppetfile

This file was deleted.

76 changes: 43 additions & 33 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
# Basic apache dev box complete with phpunit
# ready to go for ushahidi dev
Vagrant.configure("2") do |config|
config.vm.box = "puppetlabs/ubuntu-14.04-64-puppet" # vagrantcloud
config.vm.hostname = "ushahidi-platform.dev"
config.vm.network "private_network", ip: "192.168.33.110"
config.vm.synced_folder "./", "/var/www", id: "vagrant-root", :nfs => true
config.vm.network "forwarded_port", guest: 22, host: 2210
config.ssh.port = 2210

config.vm.provider :virtualbox do |virtualbox|
virtualbox.customize ["modifyvm", :id, "--name", "ushahidi-platform"]
virtualbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
virtualbox.customize ["modifyvm", :id, "--memory", "512"]
virtualbox.customize ["setextradata", :id, "--VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end

config.vm.provision :shell do |shell|
# upgrade all packages (including puppet) before using the puppet provisioner.
# this excludes grub-pc since the hard drive id changes between VMs and will cause
# an interactive prompt to appear and then error out, breaking the provisioning step.
shell.inline = "DEBIAN_FRONTEND=noninteractive apt-mark hold grub-pc && apt-get update -y && apt-get upgrade -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold'"
end

config.vm.provision :puppet do |puppet|
puppet.environment_path = "puppet/"
puppet.environment = "platform"
puppet.options = ["--verbose"]
puppet.facter = {
# Optionally pass in a github oauth token through an environment variable
"github_token" => ENV.fetch('github_token', '')
}
end
# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'json'
require 'yaml'

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

homesteadYamlPath = File.expand_path("Homestead.yaml", File.dirname(__FILE__))
homesteadJsonPath = File.expand_path("Homestead.json", File.dirname(__FILE__))
afterScriptPath = "after.sh"
aliasesPath = "aliases"

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

Vagrant.require_version '>= 1.9.0'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
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
end

if defined? VagrantPlugins::HostsUpdater
config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
end
end
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"behat/mink-extension": "^2.2",
"behat/mink-goutte-driver": "^1.2",
"satooshi/php-coveralls": "^2.0@dev",
"leanphp/phpspec-code-coverage": "~3.1"
"leanphp/phpspec-code-coverage": "~3.1",
"laravel/homestead": "^5.2"
},
"config": {
"bin-dir": "bin/",
Expand Down
54 changes: 52 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion puppet/platform/environment.conf

This file was deleted.

173 changes: 0 additions & 173 deletions puppet/platform/manifests/site.pp

This file was deleted.

5 changes: 0 additions & 5 deletions puppet/platform/modules/platform/templates/env.erb

This file was deleted.

22 changes: 0 additions & 22 deletions puppet/platform/modules/platform/templates/htaccess.erb

This file was deleted.

Loading

0 comments on commit 66a27ef

Please sign in to comment.