Skip to content

Commit 9ec9191

Browse files
committed
Merge pull request #144 from haampie/master
Add blackfire configuration to Homestead.yaml file
2 parents 7fac2b7 + 631b2fd commit 9ec9191

File tree

3 files changed

+52
-11
lines changed

3 files changed

+52
-11
lines changed

Diff for: scripts/blackfire.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
agent="[blackfire]
4+
ca-cert=
5+
collector=https://blackfire.io
6+
log-file=stderr
7+
log-level=1
8+
server-id="$1"
9+
server-token="$2"
10+
socket=unix:///var/run/blackfire/agent.sock
11+
spec=
12+
"
13+
14+
client="[blackfire]
15+
ca-cert=
16+
client-id="$3"
17+
client-token="$4"
18+
endpoint=https://blackfire.io
19+
timeout=15s
20+
"
21+
22+
echo "$agent" > "/etc/blackfire/agent"
23+
echo "$client" > "/home/vagrant/.blackfire.ini"
24+
25+
# Disable xdebug to prevent conflict
26+
php5dismod xdebug
27+
service hhvm restart
28+
service php5-fpm restart
29+
service blackfire-agent restart

Diff for: scripts/homestead.rb

+19-11
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ def Homestead.configure(config, settings)
6565

6666
# Configure All Of The Configured Databases
6767
settings["databases"].each do |db|
68-
config.vm.provision "shell" do |s|
69-
s.path = "./scripts/create-mysql.sh"
70-
s.args = [db]
71-
end
68+
config.vm.provision "shell" do |s|
69+
s.path = "./scripts/create-mysql.sh"
70+
s.args = [db]
71+
end
7272

73-
config.vm.provision "shell" do |s|
74-
s.path = "./scripts/create-postgres.sh"
75-
s.args = [db]
76-
end
73+
config.vm.provision "shell" do |s|
74+
s.path = "./scripts/create-postgres.sh"
75+
s.args = [db]
76+
end
7777
end
7878

7979
# Configure All Of The Server Environment Variables
8080
if settings.has_key?("variables")
8181
settings["variables"].each do |var|
8282
config.vm.provision "shell" do |s|
83-
s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php5/fpm/php-fpm.conf"
84-
s.args = [var["key"], var["value"]]
83+
s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php5/fpm/php-fpm.conf"
84+
s.args = [var["key"], var["value"]]
8585
end
8686

8787
config.vm.provision "shell" do |s|
@@ -91,13 +91,21 @@ def Homestead.configure(config, settings)
9191
end
9292

9393
config.vm.provision "shell" do |s|
94-
s.inline = "service php5-fpm restart"
94+
s.inline = "service php5-fpm restart"
9595
end
9696
end
9797

9898
# Update Composer On Every Provision
9999
config.vm.provision "shell" do |s|
100100
s.inline = "/usr/local/bin/composer self-update"
101101
end
102+
103+
# Configure Blackfire.io
104+
if settings.has_key?("blackfire")
105+
config.vm.provision "shell" do |s|
106+
s.path = "./scripts/blackfire.sh"
107+
s.args = [settings["blackfire"]["id"], settings["blackfire"]["token"]]
108+
end
109+
end
102110
end
103111
end

Diff for: src/stubs/Homestead.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ databases:
2222
variables:
2323
- key: APP_ENV
2424
value: local
25+
26+
# blackfire:
27+
# id: id
28+
# token: id

0 commit comments

Comments
 (0)