Files
drupal-quartiersdedemain/.githooks/pre-push
T
bachir 1ff33064cd outillage pre-deploy: front-check (balayage console/HTTP panel) + hook pre-push bloquant + fix 404 ajax-loader.gif
- scripts/front-check.js: crawl du panel ai-docs/front-pages.txt via Firefox vibe (BiDi), collecte console.error/warn + error + unhandledrejection + ressources >=400, exit 1 si erreur
- make check-front (local) / make check-front-prod, stamp .git/front-check-stamp
- .githooks/pre-push: bloque le push si le HEAD n'est pas stampé (bypass --no-verify)
- dist/assets/css/ajax-loader.gif: 404 référencé par bundle.css, copié depuis slick

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-23 00:13:37 +01:00

34 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# pre-push : bloque le push si le HEAD poussé n'a pas été front-checké.
# Le check (scripts/front-check.js via `make check-front`) écrit le stamp
# .git/front-check-stamp = sha du commit checké. Si le stamp ne correspond pas
# au HEAD, le push est refusé.
# Bypass ponctuel : git push --no-verify
set -u
GIT_DIR=$(git rev-parse --git-dir)
STAMP="$GIT_DIR/front-check-stamp"
HEAD_SHA=$(git rev-parse HEAD)
# ne s'applique que si le check est configuré (fichier de panel présent)
if [ ! -f ai-docs/front-pages.txt ]; then
exit 0
fi
if [ ! -f "$STAMP" ]; then
echo "ERREUR pre-push: aucun front-check effectué pour ce commit."
echo " Lance d'abord : make check-front (balayage console/HTTP en local sur $(git rev-parse --abbrev-ref HEAD))"
echo " Bypass si vraiment volontaire : git push --no-verify"
exit 1
fi
STAMP_SHA=$(head -1 "$STAMP" | awk '{print $1}')
if [ "$STAMP_SHA" != "$HEAD_SHA" ]; then
echo "ERREUR pre-push: le front-check date d'un autre commit."
echo " stamp=$STAMP_SHA HEAD=$HEAD_SHA"
echo " Re-lance : make check-front puis re-push. (bypass : git push --no-verify)"
exit 1
fi
echo "pre-push OK: front-check fait pour $HEAD_SHA"
exit 0