Erste Produktivversion
This commit is contained in:
43
tools/check-all.sh
Normal file
43
tools/check-all.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# Alle Prüfungen in einem Durchgang.
|
||||
#
|
||||
# bash tools/check-all.sh
|
||||
#
|
||||
# Falls das Ausführungsbit fehlt (etwa nach dem Entpacken eines Archivs):
|
||||
# chmod +x tools/*.sh
|
||||
#
|
||||
# Vor jedem docker compose build sinnvoll. Bricht beim ersten Problem ab
|
||||
# und gibt Rückgabewert 1 zurück - damit lässt es sich als Git-Hook oder
|
||||
# in einer CI verwenden.
|
||||
|
||||
set -uo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
failed=0
|
||||
run() {
|
||||
local label="$1"; shift
|
||||
printf '\n\033[1m== %s\033[0m\n' "$label"
|
||||
if "$@"; then
|
||||
:
|
||||
else
|
||||
echo " -> fehlgeschlagen"
|
||||
failed=$((failed + 1))
|
||||
fi
|
||||
}
|
||||
|
||||
[ -f .env ] && run "Konfiguration (.env)" bash tools/check-env.sh .env
|
||||
run "Konfigurationsvorlage" bash tools/check-env.sh .env.example
|
||||
run "Berechtigungen" python3 tools/check-routes.py
|
||||
run "Datenbankschema" python3 tools/check-schema.py
|
||||
run "nginx-Konfiguration" python3 tools/check-nginx.py web
|
||||
run "JavaScript-Module" node tools/check-js.mjs
|
||||
run "Strichcode-Decoder" node tools/test-barcode.mjs
|
||||
run "Python-Syntax" sh -c 'cd backend && python3 -m compileall -q app alembic && echo "in Ordnung"'
|
||||
|
||||
printf '\n'
|
||||
if [ "$failed" -eq 0 ]; then
|
||||
echo "Alle Prüfungen bestanden."
|
||||
else
|
||||
echo "$failed Prüfung(en) fehlgeschlagen."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user