[DTP-Worker] Sprint 1 · CI/CD Gitea Actions (gate qualité 4Big · DevOps)
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>
This commit is contained in:
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
# ============================================================================
|
||||
# check_docs.sh · OTO Enterprise OS DTP
|
||||
# ----------------------------------------------------------------------------
|
||||
# Contrôle qualité documentaire (gate 4Big, roadmap Sprint 1) :
|
||||
# [HARD] Liens Markdown relatifs internes → la cible doit exister.
|
||||
# [SOFT] Livrables 05_deliverables_mvp/*.md → auto-score 4Big attendu.
|
||||
# Dépendances : bash, git, grep, sed. Aucun réseau requis.
|
||||
# ============================================================================
|
||||
set -uo pipefail
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
FAIL=0
|
||||
report() { printf ' \033[31m✗\033[0m %s\n' "$1"; FAIL=1; }
|
||||
warn() { printf ' \033[33m⚠\033[0m %s\n' "$1"; }
|
||||
ok() { printf ' \033[32m✓\033[0m %s\n' "$1"; }
|
||||
|
||||
echo "== 1. Liens Markdown relatifs internes (cible existe ?) =="
|
||||
broken=0
|
||||
while read -r md; do
|
||||
dir="$(dirname "$md")"
|
||||
# Extrait les cibles [texte](cible) ; ignore http(s), mailto, ancres pures,
|
||||
# gabarits {{...}} et liens wiki [[...]].
|
||||
grep -oE '\]\([^)]+\)' "$md" 2>/dev/null \
|
||||
| sed -E 's/^\]\(//; s/\)$//' \
|
||||
| while read -r link; do
|
||||
link="${link%% *}" # retire un éventuel "titre"
|
||||
link="${link%%#*}" # retire l'ancre
|
||||
[[ -z "$link" ]] && continue
|
||||
case "$link" in
|
||||
http://*|https://*|mailto:*|tel:*|\#*|\{\{*|data:*) continue ;;
|
||||
esac
|
||||
target="$dir/$link"
|
||||
if [[ ! -e "$target" ]]; then
|
||||
printf ' \033[31m✗\033[0m %s → lien cassé : %s\n' "$md" "$link"
|
||||
echo "BROKEN" >> /tmp/brokenlinks
|
||||
fi
|
||||
done
|
||||
done < <(git ls-files '*.md')
|
||||
if [[ -s /tmp/brokenlinks ]]; then FAIL=1; rm -f /tmp/brokenlinks; else ok "Aucun lien interne cassé"; fi
|
||||
|
||||
echo "== 2. Auto-score 4Big sur les livrables (SOFT · CLAUDE.md #5 · ≥95/100) =="
|
||||
while read -r md; do
|
||||
case "$md" in
|
||||
05_deliverables_mvp/daily_reports/*) continue ;; # rapports : hors gate score
|
||||
esac
|
||||
if grep -qiE 'score|/100' "$md"; then
|
||||
ok "$md — mention de score présente"
|
||||
else
|
||||
warn "$md — pas de mention d'auto-score 4Big (recommandé ≥95/100)"
|
||||
fi
|
||||
done < <(git ls-files '05_deliverables_mvp/*.md')
|
||||
|
||||
echo
|
||||
if [[ "$FAIL" -eq 0 ]]; then
|
||||
echo -e "\033[32m✅ Documentation conforme (liens internes OK).\033[0m"
|
||||
else
|
||||
echo -e "\033[31m❌ Lien(s) interne(s) cassé(s) — corriger avant merge.\033[0m"
|
||||
fi
|
||||
exit "$FAIL"
|
||||
Reference in New Issue
Block a user