ci: tolerate legacy Backend release webhook [CI]
ci/woodpecker/pr/verify Pipeline was successful
ci/woodpecker/pr/web-build Pipeline was successful

This commit is contained in:
justme committed 2026-10-07 13:00:35 +08:00
1 parent 84f9d211bc
commit 33b9782a1d
2 files changed
+33 -3

No files matched your search

+14 -3
View File
@@ -8,7 +8,18 @@ bash "$root/ci/release-manifest.sh" "$component" "$repository" "$digest" "$tag"
if [[ -n "${RELEASE_API_URL:-}" && -n "${RELEASE_API_TOKEN:-}" ]]; then
python3 -c 'import json,sys; print(json.dumps({"manifest": open(sys.argv[1]).read(), "signature": open(sys.argv[2]).read()}))' \
"$outdir/manifest.json" "$outdir/manifest.sig" > "$outdir/payload.json"
curl --fail-with-body --silent --show-error --retry 3 -X POST "${RELEASE_API_URL%/}/api/admin/releases" \
-H "Authorization: Bearer $RELEASE_API_TOKEN" -H 'Content-Type: application/json' --data-binary "@$outdir/payload.json" >/dev/null
echo "registered the signed $component release with the panel ($channel)"
response="$outdir/response.json"
status="$(curl --silent --show-error --retry 3 -o "$response" -w '%{http_code}' -X POST "${RELEASE_API_URL%/}/api/admin/releases" \
-H "Authorization: Bearer $RELEASE_API_TOKEN" -H 'Content-Type: application/json' --data-binary "@$outdir/payload.json")"
if [[ "$status" != 2* ]]; then
if [[ "$component" == backend && "$status" == 400 ]] && grep -Fq 'manifest needs a known component' "$response"; then
echo "the panel does not support Backend update offers yet; bootstrap it once before future Backend offers"
else
echo "release offer registration failed (HTTP $status)" >&2
cat "$response" >&2
exit 1
fi
else
echo "registered the signed $component release with the panel ($channel)"
fi
fi