From 24fadc0cb2745d049939ca25bed3e6cf579a7605 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Mon, 11 Jan 2016 22:37:12 -0500 Subject: [PATCH] Add homestead support --- .env.example | 1 + .gitignore | 1 + Homestead.yaml | 37 +++++++++++++++++++++++++++++++++++++ Vagrantfile | 28 ++++++++++++++++++++++++++++ composer.json | 3 ++- 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 Homestead.yaml create mode 100644 Vagrantfile diff --git a/.env.example b/.env.example index 031862bef..5278a54f9 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ APP_DEBUG=true APP_KEY=SomeRandomString DB_HOST=localhost +DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret diff --git a/.gitignore b/.gitignore index 60d5fcd2f..5304dbe03 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /vendor *.DS_Store* .env +.vagrant/* composer.lock diff --git a/Homestead.yaml b/Homestead.yaml new file mode 100644 index 000000000..9856f8763 --- /dev/null +++ b/Homestead.yaml @@ -0,0 +1,37 @@ +--- +ip: "192.168.10.10" +memory: 512 +cpus: 1 +hostname: panel +name: panel +provider: virtualbox + +authorize: ~/.ssh/id_rsa.pub + +keys: + - ~/.ssh/id_rsa + +folders: + - map: "/path/to/local/files" + to: "/home/vagrant/panel" + type: nfs + +sites: + - map: pterodactyl.app + to: "/home/vagrant/panel/public" + +databases: + - homestead + +# blackfire: +# - id: foo +# token: bar +# client-id: foo +# client-token: bar + +# ports: +# - send: 50000 +# to: 5000 +# - send: 7777 +# to: 777 +# protocol: udp diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..5c812591a --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,28 @@ +require 'json' +require 'yaml' + +VAGRANTFILE_API_VERSION ||= "2" +confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__)) + +homesteadYamlPath = "Homestead.yaml" +homesteadJsonPath = "Homestead.json" +afterScriptPath = "after.sh" +aliasesPath = "aliases" + +require File.expand_path(confDir + '/scripts/homestead.rb') + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + if File.exists? aliasesPath then + config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases" + end + + if File.exists? homesteadYamlPath then + Homestead.configure(config, YAML::load(File.read(homesteadYamlPath))) + elsif File.exists? homesteadJsonPath then + Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath))) + end + + if File.exists? afterScriptPath then + config.vm.provision "shell", path: afterScriptPath + end +end diff --git a/composer.json b/composer.json index 994a0d2bc..5eb9cb0fd 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", "symfony/css-selector": "~3.0", - "symfony/dom-crawler": "~3.0" + "symfony/dom-crawler": "~3.0", + "laravel/homestead": "^3.0" }, "autoload": { "classmap": [