Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

thomthom's avatar

Bugsnag Deployment notification from Forge?

I'm looking to implement deployment notification from my Forge server to Bugsnag.

Reference document: https://bugsnag.com/docs/deploy-tracking-api CURL example: curl -d "apiKey=YOUR_API_KEY_HERE&appVersion=1.5" https://notify.bugsnag.com/deploy

In forge, can I add that to the last line of the deployment script?

Or is there another way to do this?

0 likes
6 replies
lindstrom's avatar
Level 15

I can't think of a better way. Bugsnag does return a response though so you might want to use this instead:

curl --silent -d "apiKey=YOUR_API_KEY_HERE&appVersion=1.5" https://notify.bugsnag.com/deploy > /dev/null
1 like
thomthom's avatar

Thanks for the suggestion @lindstrom. Any idea what the effect of not muting it would be? Would it appear in deployment log? (That wouldn't be too bad, would it?)

thomthom's avatar

I'm trying with this for the time being - allowing the deployment log to indicate success or error:

curl --silent --show-error -d "apiKey=YOUR_API_KEY_HERE&releaseStage=staging&branch=staging" https://notify.bugsnag.com/deploy
lindstrom's avatar

Right, it's not a problem. In your case you are explicitly doing the post after your deployment has run so it can't impact it. Others who want to do something anytime sooner should definitely use my approach because the response won't potentially break the deployment.

1 like
thomthom's avatar

because the response won't potentially break the deployment.

How can the response break the deployment?

Dan's avatar

@thomthom You probably don't want the deployment to continue if Bugsnag returns an error, so it would fail (break) the deployment. Another scenario where this would happen would be if you use PHPUnit - should one or more of your PHPUnit tests fail you want the deployment to fail so that it doesn't get pushed to production, for example.

1 like

Please or to participate in this conversation.