From 321b664398e35219f9124dbd1b179d4440e2d1c1 Mon Sep 17 00:00:00 2001 From: Gato Date: Sun, 7 Jun 2026 10:43:39 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20pre-push=20hook=20=E2=80=94=20build=20?= =?UTF-8?q?image=20Docker=20avant=20chaque=20push?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .githooks/pre-push | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 .githooks/pre-push diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..8504122 --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +echo "🐳 Pre-push : build de l'image Docker de production..." + +REPO_ROOT=$(git rev-parse --show-toplevel) +VERSION=$(grep '^version' "$REPO_ROOT/build.gradle" | awk -F"'" '{print $2}') +IMAGE="git.goutailler-olivier.com/gato/olhar-api:$VERSION" + +if podman build -f "$REPO_ROOT/Dockerfile" -t "$IMAGE" "$REPO_ROOT"; then + echo "✅ Build Docker rĂ©ussi ($IMAGE)" +else + echo "❌ Build Docker Ă©chouĂ© — push annulĂ©" + exit 1 +fi