Compare commits

...

3 Commits

Author SHA1 Message Date
c84176b8d3 Merge pull request 'develop' (#17) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 33s
Reviewed-on: #17
2025-12-17 16:27:26 +00:00
6125fcbd0b Merge pull request 'correction docker composer' (#16) from features/crud_entites into develop
Reviewed-on: #16
2025-12-17 16:26:17 +00:00
9336715c18 correction docker composer
All checks were successful
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 28s
2025-12-17 17:23:32 +01:00
3 changed files with 35 additions and 7 deletions

View File

@@ -69,8 +69,7 @@ jobs:
docker version || true
fi
# 7) Fournir la configuration NON sensible (OBLIGATOIRE)
# (POSTGRES_DB et POSTGRES_USER ne sont PAS des secrets)
# 7) Fournir la configuration NON sensible
- name: Export database configuration
shell: sh
run: |
@@ -102,13 +101,29 @@ jobs:
docker-compose -f docker-compose-prod.yml down --remove-orphans
docker-compose -f docker-compose-prod.yml up -d --build
# 11) Nettoyage des secrets (OBLIGATOIRE)
# 11) ✅ TEST BLOQUANT : connexion PostgreSQL
- name: Test database connection
shell: sh
run: |
echo "⏳ Waiting for PostgreSQL to be ready..."
sleep 10
echo "🔍 Testing database connection..."
docker exec fiscad-db sh -c "
export PGPASSWORD=\$(cat /run/secrets/postgresPassword) &&
psql -h localhost \
-U ${POSTGRES_USER_FISCAD} \
-d ${POSTGRES_DB_FISCAD} \
-c 'SELECT 1;'
"
# 12) Nettoyage des secrets (OBLIGATOIRE)
- name: Cleanup secrets
if: always()
shell: sh
run: rm -rf secrets
# 12) Nettoyage des images Docker inutilisées
# 13) Nettoyage des images Docker inutilisées
- name: Cleanup unused Docker images
shell: sh
run: docker image prune -f || true

View File

@@ -1,4 +1,4 @@
version: '3.9'
#version: '3.9'
services:
@@ -10,6 +10,10 @@ services:
POSTGRES_DB: ${POSTGRES_DB_FISCAD}
POSTGRES_USER: ${POSTGRES_USER_FISCAD}
POSTGRES_PASSWORD_FILE: /run/secrets/postgresPassword
secrets:
- postgresPassword
ports:
- "5432:5432"
volumes:
@@ -31,6 +35,7 @@ services:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB_FISCAD}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER_FISCAD}
SPRING_DATASOURCE_PASSWORD_FILE: /run/secrets/postgresPassword
SERVER_PORT: 8282
IO_GMSS_FISCAD_PROFILE: abomey
SPRING_PROFILES_ACTIVE: abomey
@@ -44,3 +49,11 @@ services:
volumes:
db-data-fiscad:
secrets:
defaultUserName:
file: ./secrets/defaultUserName.txt
defaultUserPassword:
file: ./secrets/defaultUserPassword.txt
postgresPassword:
file: ./secrets/postgresPassword.txt

View File

@@ -1,4 +1,4 @@
version: '3.9'
#version: '3.9'
services: