The Bugsnag Deploy Tracking API allows you to track deploys of your apps. By sending the source revision or application version when you deploy a new version of your app, you’ll be able to see which deploy each error was introduced in.
If you are using a custom notifier, or your notifier does provide appropriate
deploy tracking hooks, you can notify Bugsnag of deploys of your application
using the deploy tracking API described here. To notify Bugsnag of deploys,
simply make a HTTP POST to https://notify.bugsnag.com/deploy and Bugsnag will
save and process the deploy information.
The POST payload can either be normal form-encoded data, or a JSON object. If
you choose to POST a JSON object, make sure you set the HTTP Content-Type
header to be application/json.
You can post the following fields when notifying Bugsnag of a deploy:
apiKey
The API Key associated with the project. Informs Bugsnag which project has been deployed. This is the only required field.
releaseStage
The release stage (eg, production, staging) currently being deployed. (Optional, defaults to “production”).
repository
The url to the repository containing the source code being deployed. We can use this to link directly to your source code from the Bugsnag dashboard. (Optional).
branch
The source control branch from which you are deploying the code. (Optional).
revision
The source control (git, subversion, etc) revision id for the code you are deploying. (Optional).
appVersion
The app version of the code you are currently deploying. Only set this if you tag your releases with semantic version numbers and deploy infrequently. (Optional).
Notify Bugsnag of a deploy using curl:
curl -d "apiKey=YOUR_API_KEY_HERE&appVersion=1.5" https://notify.bugsnag.com/deploy
Note: To configure deploy tracking, replace the example text with your project’s API token, found on its project settings page.
For non-Ruby Heroku applications, you can run the following command to add a Heroku deploy hook:
$ heroku addons:add deployhooks:http --url="https://notify.bugsnag.com/deploy?\
apiKey=YOUR_API_KEY_HERE&\
revision={{head_long}}&\
releaseStage=YOUR_RELEASE_STAGE&\
repo=YOUR_GITHUB_REPO"
Note: Replace the example text with your project’s API token, found on its project settings page.