63cf28c90e
The hand-rolled pre-commit.sh reimplemented what upstream hooks already do. Move to pre-commit.com with the estate's usual pre-commit-hooks set plus hadolint and shellcheck, and keep the one check with no upstream equivalent (distros/ vs the Woodpecker matrices) as a repo: local hook. The test harness goes; tests will be reintroduced differently. - add .pre-commit-config.yaml and ci/check-distros.sh - delete pre-commit.sh, test.sh and .woodpecker/test.yaml - run uvx pre-commit run --all-files from .woodpecker/pre-commit.yaml and make pre-commit - drop the Dockerfile test stage and the make test targets
21 lines
641 B
Bash
Executable File
21 lines
641 B
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; }
|
|
done
|
|
done
|
|
|
|
exit "$fail"
|