correction docker composer
All checks were successful
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 28s
All checks were successful
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 28s
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user