Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
php: blackfireio/php@1.1.0
Use php
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Easily install and configure Blackfire for PHP. You must setup the following environment variables in your CircleCI project: - BLACKFIRE_SERVER_ID - You Blackfire server ID - BLACKFIRE_SERVER_TOKEN - You Blackfire server token - BLACKFIRE_CLIENT_ID - You Blackfire client ID - BLACKFIRE_CLIENT_TOKEN - You Blackfire client token
1
2
3
4
5
6
7
8
9
10
version: 2.1
orbs:
blackfire: blackfireio/php@x.y
jobs:
blackfire-example:
docker:
- image: circleci/php:7.3-node
steps:
- checkout
- blackfire/setup
Easily install and configure Blackfire for PHP. You must setup the following environment variables in your CircleCI project: - MY_BF_SERVER_ID - You Blackfire server ID - MY_BF_SERVER_TOKEN - You Blackfire server token - MY_BF_CLIENT_ID - You Blackfire client ID - MY_BF_CLIENT_TOKEN - You Blackfire client token
1
2
3
4
5
6
7
8
9
10
11
12
13
14
version: 2.1
orbs:
blackfire: blackfireio/php@x.y
jobs:
blackfire-example:
docker:
- image: circleci/php:7.3-node
steps:
- checkout
- blackfire/setup:
server_id: MY_BF_SERVER_ID
server_token: MY_BF_SERVER_TOKEN
client_id: MY_BF_CLIENT_ID
client_token: MY_BF_CLIENT_TOKEN
Installs and configures Blackfire for PHP. This includes the probe, the agent, the CLI and the player. Note that this will also disable XDebug as it can conflict with Blackfire probe. You won't have to consider the parameters if you already have defined the following environment variables in your CirceCI project: BLACKFIRE_SERVER_ID, BLACKFIRE_SERVER_TOKEN, BLACKFIRE_CLIENT_ID, BLACKFIRE_CLIENT_TOKEN. If you have set them with different names, you must pass them explicitly as parameters.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
server_id | Environment variable name in which your server ID is stored. | No | BLACKFIRE_SERVER_ID | env_var_name |
server_token | Environment variable name in which your server token is stored. | No | BLACKFIRE_SERVER_TOKEN | env_var_name |
client_id | Environment variable name in which your client ID is stored. | No | BLACKFIRE_CLIENT_ID | env_var_name |
client_token | Environment variable name in which your client token is stored. | No | BLACKFIRE_CLIENT_TOKEN | env_var_name |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
This orb installs and configures Blackfire for PHP.
You need an account on https://blackfire.io to use this orb.
Blackfire is the Code Performance Management solution for developers
to find and fix performance bottlenecks in dev, test/staging and production.
It makes it possible to drill down to function/method call level to understand and fix performance bottlenecks.
Its wide variety of automation options makes it a breathe to add it to a development and testing workflow.
display:
home_url: https://blackfire.io/
source_url: https://github.com/blackfireio/integration-circleci
orbs:
blackfire-agent: blackfireio/agent@dev:1.1
blackfire-player: blackfireio/player@dev:1.0
commands:
setup:
description: |
Installs and configures Blackfire for PHP.
This includes the probe, the agent, the CLI and the player.
Note that this will also disable XDebug as it can conflict with Blackfire probe.
You won't have to consider the parameters if you already have defined the following environment variables
in your CirceCI project: BLACKFIRE_SERVER_ID, BLACKFIRE_SERVER_TOKEN, BLACKFIRE_CLIENT_ID, BLACKFIRE_CLIENT_TOKEN.
If you have set them with different names, you must pass them explicitly as parameters.
parameters:
server_id:
description: Environment variable name in which your server ID is stored.
type: env_var_name
default: BLACKFIRE_SERVER_ID
server_token:
description: Environment variable name in which your server token is stored.
type: env_var_name
default: BLACKFIRE_SERVER_TOKEN
client_id:
description: Environment variable name in which your client ID is stored.
type: env_var_name
default: BLACKFIRE_CLIENT_ID
client_token:
description: Environment variable name in which your client token is stored.
type: env_var_name
default: BLACKFIRE_CLIENT_TOKEN
steps:
- blackfire-agent/setup:
server_id: << parameters.server_id >>
server_token: << parameters.server_token >>
client_id: << parameters.client_id >>
client_token: << parameters.client_token >>
- disable-xdebug
- install-player
- run:
name: 'Blackfire: Install PHP probe'
command: |
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
$SUDO docker-php-ext-configure opcache && sudo docker-php-ext-install opcache
$SUDO apt-get install blackfire-php
php -v
disable-xdebug:
description: Disables XDebug, as Blackfire may conflict with it.
steps:
- run:
name: 'Blackfire: Disable XDebug'
command: |
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
$SUDO sed -i -e "s/zend_extension=/;zend_extension=/g" /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
install-player:
description: Installs Blackfire player, to run your scenarios.
steps:
- blackfire-player/install-player
examples:
blackfire_php_default_env_vars:
description: |
Easily install and configure Blackfire for PHP.
You must setup the following environment variables in your CircleCI project:
- BLACKFIRE_SERVER_ID - You Blackfire server ID
- BLACKFIRE_SERVER_TOKEN - You Blackfire server token
- BLACKFIRE_CLIENT_ID - You Blackfire client ID
- BLACKFIRE_CLIENT_TOKEN - You Blackfire client token
usage:
version: 2.1
orbs:
blackfire: blackfireio/php@x.y
jobs:
blackfire-example:
docker:
- image: circleci/php:7.3-node
steps:
- checkout
- blackfire/setup
blackfire_php_custom_env_vars:
description: |
Easily install and configure Blackfire for PHP.
You must setup the following environment variables in your CircleCI project:
- MY_BF_SERVER_ID - You Blackfire server ID
- MY_BF_SERVER_TOKEN - You Blackfire server token
- MY_BF_CLIENT_ID - You Blackfire client ID
- MY_BF_CLIENT_TOKEN - You Blackfire client token
usage:
version: 2.1
orbs:
blackfire: blackfireio/php@x.y
jobs:
blackfire-example:
docker:
- image: circleci/php:7.3-node
steps:
- checkout
- blackfire/setup:
server_id: MY_BF_SERVER_ID
server_token: MY_BF_SERVER_TOKEN
client_id: MY_BF_CLIENT_ID
client_token: MY_BF_CLIENT_TOKEN