Files
seaweedfs/seaweed-block/scripts/refuse-lab-binary.sh
T
pingqiuandClaude Opus 5.5 73ec053d7f build: the draft v1.1 store format gets its own tag, apart from the cap lift
swblock_v11_format now turns on the draft v1.1 store format;
swblock_lab_bigvol lifts only the create cap and the headroom refusal.
A build with the format tag names itself in its revision
("LAB BUILD(swblock_v11_format)"), so the image refusal keys on it as it
does on the cap tag, and the CI tag check refuses either tag outside its
allowlist. CI tests each tag alone and both together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:12:42 -08:00

19 lines
963 B
Bash

#!/usr/bin/env bash
# refuse-lab-binary.sh BIN...: refuse to publish a lab build. Each BIN must
# answer -version, and its answer must not carry the lab marker
# (internal/buildinfo LabMarker or V11FormatMarker, set by the
# swblock_lab_bigvol or swblock_v11_format tag; both say "LAB BUILD"). A binary
# that cannot answer is refused too (fail closed). Run by every image
# Dockerfile right after its go build, so no image holding a lab binary is
# built, and so none is pushed.
set -euo pipefail
[ "$#" -gt 0 ] || { echo "refuse-lab-binary: no binary given" >&2; exit 2; }
for bin in "$@"; do
out=$("$bin" -version 2>&1) || { echo "refuse-lab-binary: $bin -version failed: $out" >&2; exit 1; }
[ -n "$out" ] || { echo "refuse-lab-binary: $bin -version printed nothing" >&2; exit 1; }
case "$out" in
*"LAB BUILD"*) echo "refuse-lab-binary: $bin is a lab build ($out); not published" >&2; exit 1 ;;
esac
echo "refuse-lab-binary: $bin ok: $out"
done