Skip to content

Commit 48055a8

Browse files
committed
fix(blackfire): update to the latest version and URLs
1 parent 81abc91 commit 48055a8

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

support/ext/blackfire

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
if [ -n "$DEBUG" ]; then
4-
set -x
4+
set -x
55
fi
66

77
# fail hard
@@ -10,50 +10,50 @@ set -o pipefail
1010
set -eu
1111

1212
php_version=${1:=8.2}
13-
php_series="$(echo $php_version | cut -d '.' -f1,2)"
14-
# https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&location=local&os=manual&language=php#install-the-php-probe
13+
php_series="$(echo "$php_version" | cut -d '.' -f1,2)"
14+
# https://docs.blackfire.io/up-and-running/installation?action=install&mode=full&location=local&os=manual&language=php&version=latest&#install-the-php-probe
1515
#
16-
#Select "Linux Binary", 64 bits, the right PHP version and you'll see the last version of the probe
17-
blackfire_probe_version=1.86.3
18-
# https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&location=local&os=manual&language=php#install-the-packages
16+
#Under "Install the PHP Probe", select "Linux Binary", 64 bits and your PHP version. Open the network inspector to identify the request triggered when you click on "Download". It contains the last version.
17+
blackfire_probe_version=1.92.41
18+
# https://docs.blackfire.io/up-and-running/installation?action=install&mode=full&location=local&os=manual&language=php&version=latest&#install-the-packages
1919
#
2020
# → Select "Linux Binary", 64 bits and you'll see the last version
21-
blackfire_agent_version=2.13.2
21+
blackfire_agent_version=2.29.0
2222
bin_dir=${PREFIX}/bin
2323

2424
# Blackfire Probe
2525
curl --location --output blackfire.so \
26-
"https://packages.blackfire.io/binaries/blackfire-php/${blackfire_probe_version}/blackfire-php-linux_amd64-php-$(echo $php_series | tr -d '.').so"
26+
"https://packages.blackfire.io/binaries/blackfire-php/${blackfire_probe_version}/blackfire-php-linux_amd64-php-$(echo "$php_series" | tr -d '.').so"
2727

28-
mkdir -p ${EXT_DIR}
29-
mv blackfire.so ${EXT_DIR}/blackfire.so
28+
mkdir -p "${EXT_DIR}"
29+
mv blackfire.so "${EXT_DIR}/blackfire.so"
3030

31-
# AGENT
32-
curl --user-agent "Scalingo" --output agent.tar.gz \
31+
# Blackfire Agent
32+
curl --user-agent "Scalingo" --output blackfire-agent.tar.gz \
3333
--dump-header - --location --silent \
34-
https://blackfire.io/api/v1/releases/agent/linux/amd64
34+
https://blackfire.io/api/v1/releases/cli/linux/amd64
3535

3636
echo "-----> Packaging bin/blackfire-agent ${blackfire_agent_version}..."
3737

38-
mkdir -p ${PREFIX}/var/blackfire/run
39-
mkdir -p ${PREFIX}/etc/blackfire
40-
echo -e "[blackfire]\nserver-id=f1abf3a8-3f85-4743-99b2-97f066c099b9\nserver-token=5ecbc6486e9db6b780a0c0a9ef1e244709e632996fe9105cb9075ab2826944d5" > ${PREFIX}/etc/blackfire/agent.ini
41-
mkdir -p ${bin_dir}
38+
mkdir -p "${PREFIX}/var/blackfire/run"
39+
mkdir -p "${PREFIX}/etc/blackfire"
40+
echo -e "[blackfire]\nserver-id=f1abf3a8-3f85-4743-99b2-97f066c099b9\nserver-token=5ecbc6486e9db6b780a0c0a9ef1e244709e632996fe9105cb9075ab2826944d5" > "${PREFIX}/etc/blackfire/agent.ini"
41+
mkdir -p "${bin_dir}"
4242

43-
tar -zxf agent.tar.gz
44-
chmod +x agent
45-
cp agent ${bin_dir}/blackfire-agent
46-
rm agent.tar.gz agent agent.sha1
43+
tar -zxf blackfire-agent.tar.gz
44+
chmod +x blackfire
45+
cp blackfire "${bin_dir}/blackfire-agent"
46+
rm blackfire-agent.tar.gz blackfire blackfire.sha1
4747

4848
# CLI
4949
echo "-----> Packaging bin/blackfire ${blackfire_agent_version}..."
50-
curl https://packages.blackfire.io/binaries/blackfire-agent/${blackfire_agent_version}/blackfire-cli-linux_amd64 > ${bin_dir}/blackfire
51-
chmod +x ${bin_dir}/blackfire
50+
curl https://packages.blackfire.io/binaries/blackfire-agent/${blackfire_agent_version}/blackfire-cli-linux_amd64 > "${bin_dir}/blackfire"
51+
chmod +x "${bin_dir}/blackfire"
5252

5353
find ${PREFIX} -type f \( -executable -o -name '*.a' \) -exec sh -c "file -i '{}' | grep -Eq 'application/x-(archive|executable|sharedlib); charset=binary'" \; -print | xargs strip --strip-unneeded
5454

5555
# gets sourced on container boot
56-
cat > ${PREFIX}/bin/profile.blackfire.sh <<'EOF'
56+
cat > "${PREFIX}/bin/profile.blackfire.sh" <<'EOF'
5757
if [[ -n "$BLACKFIRE_SERVER_TOKEN" && -n "$BLACKFIRE_SERVER_ID" ]]; then
5858
if [[ -f "/app/vendor/php/bin/blackfire-agent" ]]; then
5959
touch /app/vendor/php/var/blackfire/run/agent.sock
@@ -64,8 +64,8 @@ if [[ -n "$BLACKFIRE_SERVER_TOKEN" && -n "$BLACKFIRE_SERVER_ID" ]]; then
6464
fi
6565
EOF
6666

67-
mkdir -p ${PREFIX}/etc/php/conf.d
68-
cat > ${PREFIX}/etc/conf.d/blackfire.ini <<'EOF'
67+
mkdir -p "${PREFIX}/etc/php/conf.d"
68+
cat > "${PREFIX}/etc/conf.d/blackfire.ini" <<'EOF'
6969
extension = blackfire.so
7070
7171
blackfire.server_token = ${BLACKFIRE_SERVER_TOKEN}

0 commit comments

Comments
 (0)