Changement ci sans test
Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
+28
-28
@@ -8,37 +8,37 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Tests
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_DB: olhar_test
|
||||
POSTGRES_USER: olhar
|
||||
POSTGRES_PASSWORD: olhar
|
||||
ports:
|
||||
- 5432:5432
|
||||
# test:
|
||||
# name: Tests
|
||||
# runs-on: ubuntu-latest
|
||||
# services:
|
||||
# postgres:
|
||||
# image: postgres:16
|
||||
# env:
|
||||
# POSTGRES_DB: olhar_test
|
||||
# POSTGRES_USER: olhar
|
||||
# POSTGRES_PASSWORD: olhar
|
||||
# ports:
|
||||
# - 5432:5432
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
|
||||
- name: Build image de test
|
||||
run: docker build -f Dockerfile.test -t olhar-api-test:ci .
|
||||
# - name: Build image de test
|
||||
# run: docker build -f Dockerfile.test -t olhar-api-test:ci .
|
||||
|
||||
- name: Lancer les tests
|
||||
run: |
|
||||
docker run --rm \
|
||||
--network host \
|
||||
-e SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/olhar_test \
|
||||
-e SPRING_DATASOURCE_USERNAME=olhar \
|
||||
-e SPRING_DATASOURCE_PASSWORD=olhar \
|
||||
-e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver \
|
||||
-e SECURITY_JWT_SECRET=test-secret-key-for-ci-testing-only-must-be-long-enough \
|
||||
olhar-api-test:ci \
|
||||
./gradlew test --no-daemon
|
||||
# - name: Lancer les tests
|
||||
# run: |
|
||||
# docker run --rm \
|
||||
# --network host \
|
||||
# -e SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/olhar_test \
|
||||
# -e SPRING_DATASOURCE_USERNAME=olhar \
|
||||
# -e SPRING_DATASOURCE_PASSWORD=olhar \
|
||||
# -e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver \
|
||||
# -e SECURITY_JWT_SECRET=test-secret-key-for-ci-testing-only-must-be-long-enough \
|
||||
# olhar-api-test:ci \
|
||||
# ./gradlew test --no-daemon
|
||||
|
||||
build-and-push:
|
||||
name: Build & push image Docker
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
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"
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user