Files
container-base/ci/check-distros.sh
T
unkin-agent b9d45eff68
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
Build through artifactapi and get the internal CA into buildkit
The buildkit_config setting does not exist in the plugin-docker-buildx build
we run: the binary has no PLUGIN_BUILDKIT_CONFIG, so the block was dead YAML
and `docker buildx create` ran without --config. The plugin only writes a
buildkit.toml (pointing at /etc/docker/certs.d/<registry>/ca.crt) when
`registry` is set, which is why the tag build pushed fine and the PR build
had no CA. Set registry on every step and drop the dead block.

The matrix also overrode BASE_IMAGE with the Docker Hub path, so CI never
used the artifactapi remote that distro.env selects. Point it at artifactapi
and have ci/check-distros.sh fail when a matrix value restating a distro.env
key drifts from it.
2026-09-27 22:18:51 +10:00

40 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Every distros/<name>/ needs a complete distro.env and an entry in every Woodpecker
# matrix, or a newly added distro silently never gets built.
set -uo pipefail
KEYS="BASE_IMAGE IMAGE CA_RPM_URL CA_RPM_SHA256 ESTATE_REPO PACKAGES"
WORKFLOWS=(.woodpecker/build.yaml .woodpecker/docker.yaml)
fail=0
for d in distros/*/; do
n=$(basename "$d")
for k in $KEYS; do
grep -q "^${k}=" "${d}distro.env" || { echo "${d}distro.env: missing ${k}"; fail=1; }
done
for wf in "${WORKFLOWS[@]}"; do
grep -q "DISTRO: ${n}\$" "$wf" || { echo "${wf}: distro ${n} missing from matrix"; fail=1; }
# A matrix entry that restates a distro.env key must not drift from it — a stale
# BASE_IMAGE here silently overrides distro.env for every CI build.
while IFS='=' read -r k v; do
[ -n "$k" ] || continue
grep -q "^${k}=" "${d}distro.env" || continue
ev=$(sed -n "s/^${k}=//p" "${d}distro.env" | head -1 | sed 's/^"//;s/"$//')
[ "$v" = "$ev" ] || { echo "${wf}: matrix ${k}=\"${v}\" for ${n} disagrees with ${d}distro.env (\"${ev}\")"; fail=1; }
done <<EOF
$(awk -v d="$n" '
$0 ~ "^[[:space:]]*-[[:space:]]+DISTRO:[[:space:]]*"d"[[:space:]]*$" { inb=1; next }
inb && /^[[:space:]]*-/ { inb=0 }
inb && match($0, /^[[:space:]]+[A-Z_]+:/) {
k=$1; sub(/:$/,"",k)
v=$0; sub(/^[[:space:]]*[A-Z_]+:[[:space:]]*/,"",v); gsub(/^"|"$/,"",v)
print k "=" v
}
' "$wf")
EOF
done
done
exit "$fail"