From d64abcd9c5914a957a059c3e2792099ae76e853e Mon Sep 17 00:00:00 2001 From: Gato Date: Sun, 7 Jun 2026 10:44:47 +0200 Subject: [PATCH] chore: git pull --rebase avant le build dans le hook pre-push Co-Authored-By: Claude Sonnet 4.6 --- .githooks/pre-push | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index 8504122..e386afc 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -1,9 +1,16 @@ #!/usr/bin/env bash set -euo pipefail -echo "🐳 Pre-push : build de l'image Docker de production..." - REPO_ROOT=$(git rev-parse --show-toplevel) +BRANCH=$(git symbolic-ref --short HEAD) + +echo "🔄 Pre-push : synchronisation avec origin/$BRANCH..." +if ! git pull --rebase origin "$BRANCH"; then + echo "❌ git pull --rebase a échoué — résous les conflits avant de pousser" + exit 1 +fi + +echo "🐳 Pre-push : build de l'image Docker de production..." VERSION=$(grep '^version' "$REPO_ROOT/build.gradle" | awk -F"'" '{print $2}') IMAGE="git.goutailler-olivier.com/gato/olhar-api:$VERSION"