VERSION (racine) devient la source unique de verite MAJEUR.MINEUR.CORRECTIF, incrementee a chaque commit par le hook prepare-commit-msg (BREAKING -> majeur, feat -> mineur, sinon correctif) ; post-commit rattache les fichiers derives au commit et cree le tag vX.Y.Z, publie au push (push.followTags). Tous les derives sont resynchronises : package.json, desktop Tauri, README.md/README.fr.md, docs/ROADMAP.md, CHANGELOG.md. Backend, image Docker et desktop lisent le meme fichier (plus de numero code en dur). Outils : scripts/bump_version.py, scripts/install-hooks.sh. Tests : tests/test_version.py (46, garde-fou de coherence globale).
30 lines
1.1 KiB
Bash
30 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
# -----------------------------------------------------------------------------
|
|
# ObsiGate — installe les hooks git versionnés (.githooks).
|
|
#
|
|
# 1. `core.hooksPath = .githooks` -> hooks partagés par tout le monde (versionnés)
|
|
# 2. `push.followTags = true` -> le tag de version créé au commit est publié
|
|
# automatiquement à chaque `git push`
|
|
#
|
|
# À exécuter une fois par clone : scripts/install-hooks.sh
|
|
# -----------------------------------------------------------------------------
|
|
set -euo pipefail
|
|
|
|
root="$(git rev-parse --show-toplevel)"
|
|
cd "$root"
|
|
|
|
if [ ! -d .githooks ]; then
|
|
echo "✗ Dossier .githooks introuvable." >&2
|
|
exit 1
|
|
fi
|
|
|
|
git config core.hooksPath .githooks
|
|
git config push.followTags true
|
|
chmod +x .githooks/* 2>/dev/null || true
|
|
|
|
echo "✓ Hooks installés :"
|
|
echo " core.hooksPath = $(git config --get core.hooksPath)"
|
|
echo " push.followTags = $(git config --get push.followTags)"
|
|
echo " → La version (./VERSION) est incrémentée à chaque commit et taguée"
|
|
echo " (vX.Y.Z), puis publiée avec la branche à chaque push."
|