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