Get started with the Buildkite PubSub Webhook service locally in under 10 minutes.
- Clone the repository:
git clone <your-repo-url>
cd buildkite-pubsub
- Generate a webhook token:
# You can use any secure random string
export BUILDKITE_WEBHOOK_TOKEN=$(openssl rand -hex 16)
- Run the service:
go run cmd/webhook/main.go
- In another terminal, start ngrok:
ngrok http 8080
-
Configure the webhook in Buildkite:
- Go to Organization Settings → Webhooks
- Click "Add Webhook"
- URL: Your ngrok URL +
/webhook
(e.g.,https://abc123.ngrok.io/webhook
) - Events: Select "All Events" for testing
- Token: Use the value from
$BUILDKITE_WEBHOOK_TOKEN
- SSL: Enable (ngrok provides SSL)
-
Test the webhook:
# Send a test ping using your ngrok URL
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Buildkite-Token: $BUILDKITE_WEBHOOK_TOKEN" \
https://your-ngrok-url/webhook \
-d '{"event":"ping"}'
# Expected response:
# {"message":"Pong! Webhook received successfully"}
- Create a build in Buildkite
- Watch the service logs to see the events
- You should see build.scheduled, build.started, and build.finished events
- Ready to deploy to GCP? See the GCP Setup Guide
- Want to explore event types? Check the Usage Guide
- Need monitoring? See the Monitoring Guide