Skip to content

Commit 24fadc0

Browse files
committed
Add homestead support
1 parent fa56165 commit 24fadc0

File tree

5 files changed

+69
-1
lines changed

5 files changed

+69
-1
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ APP_DEBUG=true
33
APP_KEY=SomeRandomString
44

55
DB_HOST=localhost
6+
DB_PORT=3306
67
DB_DATABASE=homestead
78
DB_USERNAME=homestead
89
DB_PASSWORD=secret

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/vendor
22
*.DS_Store*
33
.env
4+
.vagrant/*
45

56
composer.lock

Homestead.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
ip: "192.168.10.10"
3+
memory: 512
4+
cpus: 1
5+
hostname: panel
6+
name: panel
7+
provider: virtualbox
8+
9+
authorize: ~/.ssh/id_rsa.pub
10+
11+
keys:
12+
- ~/.ssh/id_rsa
13+
14+
folders:
15+
- map: "/path/to/local/files"
16+
to: "/home/vagrant/panel"
17+
type: nfs
18+
19+
sites:
20+
- map: pterodactyl.app
21+
to: "/home/vagrant/panel/public"
22+
23+
databases:
24+
- homestead
25+
26+
# blackfire:
27+
# - id: foo
28+
# token: bar
29+
# client-id: foo
30+
# client-token: bar
31+
32+
# ports:
33+
# - send: 50000
34+
# to: 5000
35+
# - send: 7777
36+
# to: 777
37+
# protocol: udp

Vagrantfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require 'json'
2+
require 'yaml'
3+
4+
VAGRANTFILE_API_VERSION ||= "2"
5+
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
6+
7+
homesteadYamlPath = "Homestead.yaml"
8+
homesteadJsonPath = "Homestead.json"
9+
afterScriptPath = "after.sh"
10+
aliasesPath = "aliases"
11+
12+
require File.expand_path(confDir + '/scripts/homestead.rb')
13+
14+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
15+
if File.exists? aliasesPath then
16+
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
17+
end
18+
19+
if File.exists? homesteadYamlPath then
20+
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
21+
elsif File.exists? homesteadJsonPath then
22+
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
23+
end
24+
25+
if File.exists? afterScriptPath then
26+
config.vm.provision "shell", path: afterScriptPath
27+
end
28+
end

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"phpunit/phpunit": "~4.0",
2323
"phpspec/phpspec": "~2.1",
2424
"symfony/css-selector": "~3.0",
25-
"symfony/dom-crawler": "~3.0"
25+
"symfony/dom-crawler": "~3.0",
26+
"laravel/homestead": "^3.0"
2627
},
2728
"autoload": {
2829
"classmap": [

0 commit comments

Comments
 (0)