Drone CI / Woodpecker ingest
Send Drone or Woodpecker pipeline logs to Exlogare via an on-failure step.
Exlogare’s POST /api/ingest/drone endpoint works with both Drone CI (the Harness-maintained engine) and Woodpecker CI (the community fork) — they share the same env-var contract.
Required fields
| Field | Type | Notes |
|---|---|---|
repo | string | org/repo (DRONE_REPO). |
build_number | int | DRONE_BUILD_NUMBER. |
status | string | failure / success / error / killed. |
log | string | Failed-step log, up to 10 MiB. |
pipeline, step, branch, commit_sha, build_url | optional |
Drone CI
kind: pipeline
type: docker
name: ci
steps:
- name: test
image: golang:1.22
commands:
- go test ./... 2>&1 | tee /drone/src/build.log
- exit ${PIPESTATUS[0]}
- name: send-failure-log
image: alpine
when:
status: [ failure ]
environment:
EXLOGARE_TOKEN:
from_secret: exlogare_token
commands:
- apk add --no-cache curl jq
- |
curl -fsS -X POST https://api.exlogare.net/api/ingest/drone \
-H "Authorization: Bearer $EXLOGARE_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n \
--arg repo "$DRONE_REPO" \
--arg br "$DRONE_BRANCH" \
--arg sha "$DRONE_COMMIT" \
--arg url "$DRONE_BUILD_LINK" \
--arg log "$(cat /drone/src/build.log)" \
'{repo:$repo, build_number:'$DRONE_BUILD_NUMBER', status:"failure", branch:$br, commit_sha:$sha, build_url:$url, log:$log}')"
Woodpecker CI
The shape is identical; replace DRONE_* env vars with the Woodpecker equivalents:
steps:
send-failure-log:
image: alpine
when:
status: [ failure ]
environment:
EXLOGARE_TOKEN:
from_secret: exlogare_token
commands:
- apk add --no-cache curl jq
- |
curl -fsS -X POST https://api.exlogare.net/api/ingest/drone \
-H "Authorization: Bearer $EXLOGARE_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n \
--arg repo "$CI_REPO" \
--arg br "$CI_COMMIT_BRANCH" \
--arg sha "$CI_COMMIT_SHA" \
--arg url "$CI_PIPELINE_URL" \
--arg log "$(cat build.log)" \
'{repo:$repo, build_number:'$CI_PIPELINE_NUMBER', status:"failure", branch:$br, commit_sha:$sha, build_url:$url, log:$log}')"
Tips
- Capture the previous step’s log via
teebecause Drone/Woodpecker do not expose a runtime “give me the log of the previous step” call. - Use the engine’s secret manager (
from_secret) so the token never appears in YAML history. - Both engines support
failure/killedfor forced-cancellation. Both map to a Drone-stylefailurefor our analysis.