Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 1.58 KB

QUICK_START.md

File metadata and controls

66 lines (51 loc) · 1.58 KB

Quick Start Guide

Get started with the Buildkite PubSub Webhook service locally in under 10 minutes.

Prerequisites

Setup

  1. Clone the repository:
git clone <your-repo-url>
cd buildkite-pubsub
  1. Generate a webhook token:
# You can use any secure random string
export BUILDKITE_WEBHOOK_TOKEN=$(openssl rand -hex 16)
  1. Run the service:
go run cmd/webhook/main.go
  1. In another terminal, start ngrok:
ngrok http 8080
  1. 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)
  2. 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"}

Verify Webhook Events

  1. Create a build in Buildkite
  2. Watch the service logs to see the events
  3. You should see build.scheduled, build.started, and build.finished events

Next Steps