Skip to content
This repository was archived by the owner on Mar 11, 2020. It is now read-only.

Commit 0e1b4b5

Browse files
committed
Use per project homestead
1 parent c6388b1 commit 0e1b4b5

9 files changed

+244
-97
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ deployment.xml
1717
/web/uploads/*
1818
!/web/uploads/dummyphoto.jpg
1919
phinx.yml
20+
Homestead.yaml

.travis.yml

-28
This file was deleted.

Homestead.default

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
ip: "192.168.10.10"
3+
memory: 2048
4+
cpus: 1
5+
hostname: techcampcfp
6+
name: techcampcfp
7+
provider: virtualbox
8+
9+
authorize: ~/.ssh/id_rsa.pub
10+
11+
keys:
12+
- ~/.ssh/id_rsa
13+
14+
folders:
15+
- map: "/Users/halo/PhpstormProjects/TechCampCFP"
16+
to: "/home/vagrant/techcampcfp"
17+
18+
sites:
19+
- map: homestead.app
20+
to: "/home/vagrant/techcampcfp/web"
21+
22+
databases:
23+
- opencfp
24+
25+
variables:
26+
- key: CFP_ENV
27+
value: development
28+
29+
# blackfire:
30+
# - id: foo
31+
# token: bar
32+
# client-id: foo
33+
# client-token: bar
34+
35+
# ports:
36+
# - send: 50000
37+
# to: 5000
38+
# - send: 7777
39+
# to: 777
40+
# protocol: udp

Homestead.yaml

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,40 @@
11
---
22
ip: "192.168.10.10"
3-
memory: 1024
4-
cpus: 2
3+
memory: 2048
4+
cpus: 1
5+
hostname: techcampcfp
6+
name: techcampcfp
7+
provider: virtualbox
58

69
authorize: ~/.ssh/id_rsa.pub
710

811
keys:
912
- ~/.ssh/id_rsa
1013

1114
folders:
12-
- map: .
13-
to: /home/vagrant/cfp.dev
14-
- map: .
15-
to: /vagrant
15+
- map: "/Users/halo/PhpstormProjects/TechCampCFP"
16+
to: "/home/vagrant/techcampcfp"
1617

1718
sites:
18-
- map: cfp.dev
19-
to: /home/vagrant/cfp.dev/web
19+
- map: homestead.app
20+
to: "/home/vagrant/techcampcfp/web"
2021

2122
databases:
2223
- opencfp
2324

2425
variables:
2526
- key: CFP_ENV
2627
value: development
28+
29+
# blackfire:
30+
# - id: foo
31+
# token: bar
32+
# client-id: foo
33+
# client-token: bar
34+
35+
# ports:
36+
# - send: 50000
37+
# to: 5000
38+
# - send: 7777
39+
# to: 777
40+
# protocol: udp

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ Based on [OpenCFP](https://github.com/opencfp/opencfp)
55
### Usage
66

77
* Clone this repo
8-
* Add ```192.168.10.10 cfp.dev``` to your hosts file (/etc/hosts)
8+
* Run `composer install`
9+
* Run `./vendor/bin/homestead make`
10+
* Ensure `Homestead.yaml` contains everything from `Homestead.default`
911
* Run ```vagrant up``` from the root of the project
1012
* Open [http://cfp.dev](http://cfp.dev) in a browser
1113
* Register a new account

Vagrantfile

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
require 'json'
22
require 'yaml'
33

4-
VAGRANTFILE_API_VERSION = "2"
5-
confDir = $confDir ||= File.expand_path(".")
4+
VAGRANTFILE_API_VERSION ||= "2"
5+
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
66

7-
homesteadYamlPath = confDir + "/Homestead.yaml"
8-
afterScriptPath = confDir + "/scripts/after.sh"
9-
aliasesPath = confDir + "/aliases"
7+
homesteadYamlPath = "Homestead.yaml"
8+
homesteadJsonPath = "Homestead.json"
9+
afterScriptPath = "after.sh"
10+
aliasesPath = "aliases"
1011

11-
require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')
12+
require File.expand_path(confDir + '/scripts/homestead.rb')
1213

1314
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
14-
if File.exists? aliasesPath then
15-
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
16-
end
15+
if File.exists? aliasesPath then
16+
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
17+
end
1718

18-
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
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
1924

20-
if File.exists? afterScriptPath then
21-
config.vm.provision "shell", path: afterScriptPath
22-
end
25+
if File.exists? afterScriptPath then
26+
config.vm.provision "shell", path: afterScriptPath
27+
end
2328
end

aliases

+27-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,34 @@
11
alias ..="cd .."
22
alias ...="cd ../.."
3-
alias artisan="php artisan"
3+
44
alias h='cd ~'
55
alias c='clear'
6+
alias artisan='php artisan'
7+
8+
alias phpspec='vendor/bin/phpspec'
9+
alias phpunit='vendor/bin/phpunit'
10+
alias serve=serve-laravel
611

7-
function serve() {
8-
if [[ "$1" && "$2" ]]
9-
then
10-
sudo dos2unix /vagrant/scripts/serve.sh
11-
sudo bash /vagrant/scripts/serve.sh "$1" "$2"
12-
else
13-
echo "Error: missing required parameters."
14-
echo "Usage: "
15-
echo " serve domain path"
16-
fi
12+
function serve-laravel() {
13+
if [[ "$1" && "$2" ]]
14+
then
15+
sudo dos2unix /vagrant/scripts/serve-laravel.sh
16+
sudo bash /vagrant/scripts/serve-laravel.sh "$1" "$2" 80
17+
else
18+
echo "Error: missing required parameters."
19+
echo "Usage: "
20+
echo " serve domain path"
21+
fi
1722
}
1823

24+
function serve-hhvm() {
25+
if [[ "$1" && "$2" ]]
26+
then
27+
sudo dos2unix /vagrant/scripts/serve-hhvm.sh
28+
sudo bash /vagrant/scripts/serve-hhvm.sh "$1" "$2" 80
29+
else
30+
echo "Error: missing required parameters."
31+
echo "Usage: "
32+
echo " serve-hhvm domain path"
33+
fi
34+
}

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"mockery/mockery": "1.0.*@dev",
4545
"fzaninotto/faker": "1.2.*",
4646
"codeclimate/php-test-reporter": "dev-master",
47-
"johnkary/phpunit-speedtrap": "~1.0@dev"
47+
"johnkary/phpunit-speedtrap": "~1.0@dev",
48+
"laravel/homestead": "^3.0"
4849
}
4950
}

0 commit comments

Comments
 (0)