Fix blackfire-agent setup

This commit is contained in:
Shivam Mathur 2020-06-02 22:12:46 +05:30
parent 4f0d9003dc
commit 94616818f0
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
3 changed files with 17 additions and 10 deletions

View File

@ -178,9 +178,13 @@ add_blackfire() {
sudo mkdir -p usr/local/var/run sudo mkdir -p usr/local/var/run
brew tap blackfireio/homebrew-blackfire >/dev/null 2>&1 brew tap blackfireio/homebrew-blackfire >/dev/null 2>&1
brew install blackfire-agent >/dev/null 2>&1 brew install blackfire-agent >/dev/null 2>&1
if [[ -n $BLACKFIRE_SERVER_ID ]] && [[ -n $BLACKFIRE_SERVER_TOKEN ]]; then
sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1 sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1
brew services start blackfire-agent >/dev/null 2>&1 brew services start blackfire-agent >/dev/null 2>&1
sudo blackfire --config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1 fi
if [[ -n $BLACKFIRE_CLIENT_ID ]] && [[ -n $BLACKFIRE_CLIENT_TOKEN ]]; then
sudo blackfire config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1
fi
add_log "$tick" "blackfire" "Added" add_log "$tick" "blackfire" "Added"
add_log "$tick" "blackfire-agent" "Added" add_log "$tick" "blackfire-agent" "Added"
} }

View File

@ -267,14 +267,17 @@ add_devtools() {
# Function to add blackfire and blackfire-agent. # Function to add blackfire and blackfire-agent.
add_blackfire() { add_blackfire() {
sudo mkdir -p /var/run/blackfire sudo mkdir -p /var/run/blackfire
sudo curl -o /tmp/blackfire-gpg.key -sSL https://packages.blackfire.io/gpg.key >/dev/null 2>&1 sudo curl -sSL https://packages.blackfire.io/gpg.key | sudo apt-key add - >/dev/null 2>&1
sudo apt-key add /tmp/blackfire-gpg.key >/dev/null 2>&1
echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list >/dev/null 2>&1 echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list >/dev/null 2>&1
find /etc/apt/sources.list.d -type f -name blackfire.list -exec sudo "$debconf_fix" apt-fast update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1 sudo "$debconf_fix" apt-get update >/dev/null 2>&1
$apt_install blackfire-agent >/dev/null 2>&1 $apt_install blackfire-agent >/dev/null 2>&1
if [[ -n $BLACKFIRE_SERVER_ID ]] && [[ -n $BLACKFIRE_SERVER_TOKEN ]]; then
sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1 sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1
sudo /etc/init.d/blackfire-agent restart >/dev/null 2>&1 sudo /etc/init.d/blackfire-agent restart >/dev/null 2>&1
sudo blackfire --config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1 fi
if [[ -n $BLACKFIRE_CLIENT_ID ]] && [[ -n $BLACKFIRE_CLIENT_TOKEN ]]; then
sudo blackfire config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1
fi
add_log "$tick" "blackfire" "Added" add_log "$tick" "blackfire" "Added"
add_log "$tick" "blackfire-agent" "Added" add_log "$tick" "blackfire-agent" "Added"
} }

View File

@ -245,7 +245,7 @@ Function Add-Blackfire() {
blackfire-agent --register --server-id=$env:BLACKFIRE_SERVER_ID --server-token=$env:BLACKFIRE_SERVER_TOKEN >$null 2>&1 blackfire-agent --register --server-id=$env:BLACKFIRE_SERVER_ID --server-token=$env:BLACKFIRE_SERVER_TOKEN >$null 2>&1
} }
if ((Test-Path env:BLACKFIRE_CLIENT_ID) -and (Test-Path env:BLACKFIRE_CLIENT_TOKEN)) { if ((Test-Path env:BLACKFIRE_CLIENT_ID) -and (Test-Path env:BLACKFIRE_CLIENT_TOKEN)) {
blackfire --config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem >$null 2>&1 blackfire config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem >$null 2>&1
} }
Add-Log $tick "blackfire" "Added" Add-Log $tick "blackfire" "Added"
Add-Log $tick "blackfire-agent" "Added" Add-Log $tick "blackfire-agent" "Added"