An example Buildkite webhook endpoint for retrying builds n
number of times if they have the retry_build
meta-data build property present.
-
Create an API Access token: In your Buildkite Personal Settings → API Access Tokens create a token with
write_builds
permission. -
Find the secret: In your new Heroku app go to Settings → Config Variables → Reveal Config Variables, and copy the
WEBHOOK_TOKEN
variable value. -
Set up the webhook: In Buildkite go to Settings → Notifications → Webhooks and add a new webhook pointing to your new Heroku app, and using the token you copied from your Heroku app’s config.
-
Trigger a build via the API: Be sure to include
"meta-data": {"retry_build": n}
🎉
See the LICENSE file for license rights and limitations (MIT).