[#454] adopt enforcement framework + STATUS; modernize librenms agent scripts

check-rules green; shellcheck fixes to dpkg.sh/os-updates.sh (legacy
backticks, unquoted vars, array-quoted command builders); Discourse
pointers added to basis docs; awx/k8s/compliance repos referenced.
https://projects.knownelement.com/issues/454
This commit is contained in:
2026-09-05 05:35:44 -05:00
parent 2eccacd024
commit 962a8f197d
19 changed files with 829 additions and 53 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# pre-push — full rule audit + clean-working-tree gate before pushing.
# Installed via: bash scripts/setup-hooks.sh
#
# Combines two proven policies observed across projects:
# - KNEL-AIMiddleware: block push if the working tree is dirty.
# - RCEO-PersonalAssistant: block push if the full test suite fails.
set -euo pipefail
REPO_ROOT="$(git rev-parse --show-toplevel)"
cd "$REPO_ROOT"
echo "pre-push: running full rule audit..."
# Full audit (non-fast): runs the slow test suite via `make test` if present.
if ! bash scripts/check-rules.sh --quiet; then
echo ""
echo "pre-push audit FAILED. Push blocked."
echo "Re-run with output: bash scripts/check-rules.sh"
echo "Bypass: git push --no-verify (emergencies only)"
exit 1
fi
echo "pre-push: all rules and tests passed."
exit 0