1cfb8191f4
Débloque le dernier livrable DevOps Sprint 1 authorable en-repo (GAP §7). - .gitea/workflows/ci.yml : pipeline Gitea Actions (Gitea ONLY, jamais GitHub) 4 jobs : constraints-guard · validate-json · check-docs · gate agrégat. - ci/guard_constraints.sh : enforce contraintes NON-NÉGOCIABLES CLAUDE.md (GitHub/GitLab/Bitbucket #2 · EspoCRM/HubSpot #3 · Stripe #10 · /var/www/html/static · git clean · remote non-Gitea). Heuristique zéro faux positif (ignore lignes de prohibition) + escape ci-allow. - ci/validate_json.sh : parse strict schémas Faisabilité↔Publiciste. - ci/check_docs.sh : liens Markdown internes [HARD] + auto-score 4Big [SOFT]. - ci/README.md : doc pipeline + procédure enregistrement act_runner (VPS/DevOps). - GAP_ANALYSIS §7 : critère CI/CD Gitea Actions -> done (runner VPS restant). Validé localement : 3 scripts verts (exit 0) sans faux positif ; test négatif (hubspot+github.com) -> guard exit 1 correct. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
1.3 KiB
Bash
Executable File
40 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# ============================================================================
|
|
# validate_json.sh · OTO Enterprise OS DTP
|
|
# ----------------------------------------------------------------------------
|
|
# Valide que tous les fichiers .json suivis sont bien formés (parse strict).
|
|
# Les schémas JSON (version.schema.json, projets_master.schema.json) sont le
|
|
# contrat de données Faisabilité ↔ Publiciste : un JSON cassé bloque le
|
|
# pipeline en aval → on l'attrape ici.
|
|
# Dépendances : bash, git, python3. Aucun réseau requis.
|
|
# ============================================================================
|
|
set -uo pipefail
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
FAIL=0
|
|
mapfile -t files < <(git ls-files '*.json')
|
|
|
|
if [[ "${#files[@]}" -eq 0 ]]; then
|
|
echo "Aucun fichier .json suivi — rien à valider."
|
|
exit 0
|
|
fi
|
|
|
|
for f in "${files[@]}"; do
|
|
if python3 -c "import json,sys; json.load(open(sys.argv[1]))" "$f" 2>/tmp/jsonerr; then
|
|
printf ' \033[32m✓\033[0m %s\n' "$f"
|
|
# Si un $schema est déclaré, contrôle que 'draft' est reconnu (info seule).
|
|
else
|
|
printf ' \033[31m✗\033[0m %s\n' "$f"
|
|
sed 's/^/ /' /tmp/jsonerr
|
|
FAIL=1
|
|
fi
|
|
done
|
|
|
|
echo
|
|
if [[ "$FAIL" -eq 0 ]]; then
|
|
echo -e "\033[32m✅ Tous les JSON sont bien formés.\033[0m"
|
|
else
|
|
echo -e "\033[31m❌ JSON invalide détecté.\033[0m"
|
|
fi
|
|
exit "$FAIL"
|