27 Commits
Author SHA1 Message Date
ucef c778dea9a0 fix(ci): combine --net=host with Base64 payload transfer for key, script, and env to resolve VPN routing and file isolation
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 1m59s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Successful in 1m19s
2026-09-04 08:10:08 +02:00
ucef 2720a2193d fix(ci): execute deployment directly in runner step environment without nested container
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 1m59s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m27s
2026-09-04 08:03:23 +02:00
ucef e1d797eb01 fix(ci): use GITHUB_WORKSPACE for repository volume mount and absolute path /workspace/ for rsync
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m1s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m16s
2026-09-04 07:26:53 +02:00
ucef c06abb1d17 fix(ci): re-wrap PEM payload to 64 chars with explicit trailing newline
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 1m56s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m18s
2026-09-04 07:18:12 +02:00
ucef 0a56944daa fix(ci): validate SSH key header format and provide explicit guidance for Gitea secret value
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m3s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m13s
2026-09-04 07:04:21 +02:00
ucef 292c2bb8ec fix(ci): handle file paths in RAW_KEY and add key line count diagnostic logs
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m9s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m14s
2026-09-03 15:55:13 +02:00
ucef a991fd9f35 fix(ci): pass SSH key as base64 environment variable to completely eliminate volume mount issues
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m9s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m14s
2026-09-03 15:47:40 +02:00
ucef 5fb6356f8a fix(ci): strict regular file check and explicit error message when PROD_DB_SSH_KEY is missing
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m7s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m14s
2026-09-03 15:39:35 +02:00
ucef 9990bba799 fix(ci): write secret key to runner file before docker run to preserve multi-line format
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m4s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m14s
2026-09-03 15:26:22 +02:00
ucef 494fcfbf8a fix(ci): use PROD_DB_SSH_KEY Gitea secret for reliable cross-runner authentication
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m1s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m13s
2026-09-03 15:19:28 +02:00
ucef 5e7e5c461c security: replace key header log with safe public ssh-keygen fingerprint display
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m13s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m20s
2026-09-03 15:11:16 +02:00
ucef 63bc5da40c ci: add comprehensive diagnostic logs and ssh -vv trace to step 2026-09-03 15:09:07 +02:00
ucef a4c852d254 fix(ci): mount /home/ucef/.ssh and prioritize gitea_ci_key over generic host keys
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m5s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m22s
2026-09-03 15:02:09 +02:00
ucef 815eb72834 fix(ci): copy key to /tmp/id_rsa instead of ~/.ssh/id_rsa to avoid read-only mount error
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m6s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m23s
2026-09-03 14:56:31 +02:00
ucef 881a81f53b fix(ci): robust SSH key resolution supporting both file paths and Gitea secrets
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m6s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m15s
2026-09-03 14:49:33 +02:00
ucef 747cf1a0fa refactor(ci): simplify SSH step to directly copy and use /root/.ssh/gitea_ci_key with 600 permissions
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m8s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m14s
2026-09-03 14:40:45 +02:00
ucef 2472407cca fix(ci): prioritize /root/.ssh/gitea_ci_key mount
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m15s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m27s
2026-09-03 14:29:20 +02:00
ucef 02f9674b7a fix(ci): mount /home/ubuntu/.ssh and auto-detect gitea_ci_key location 2026-09-03 14:26:53 +02:00
ucef 0963e25cfb fix(ci): add UserKnownHostsFile=/dev/null and target gitea_ci_key to fix read-only ssh error
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m10s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m22s
2026-09-03 14:05:44 +02:00
ucef 8c8df282a4 refactor(ci): mount host .ssh directory directly in docker step container
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m15s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m26s
2026-09-03 13:16:03 +02:00
ucef 41f8b67602 fix(ci): strip carriage returns from SSH key and force IdentitiesOnly=yes to fix libcrypto unsupported error
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m14s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m23s
2026-09-03 12:59:24 +02:00
ucef 47b27d3cfd fix(ci): run rsync DB script deployment with host network (--net=host) to fix VPN timeout
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m33s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m31s
2026-09-03 12:51:10 +02:00
ucef 272a4ad8e2 fix(ci): preserve SSH key linebreaks with printf and add custom port support
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m2s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 1m23s
2026-09-03 10:04:34 +02:00
ucef deba5fafea fix(ci): check all SSH key secret variants and force rsync deployment to DB server
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m34s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Failing after 3m32s
2026-09-03 08:03:03 +02:00
ucef 0a56d83e2e feat(ci): add step to deploy backup script and env to DB server (10.8.0.3) via rsync
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m10s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Successful in 1m12s
2026-09-03 07:54:18 +02:00
ucef eaa54b767b feat(backup): add automated DB backup script, rsync support and Gitea CI secret integration
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m8s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Successful in 1m12s
2026-09-03 07:47:01 +02:00
ucef 21aabb778a chore: prepare release 1.8
AS Talange CI/CD Pipeline - Production / Build & Run Unit Tests (push) Successful in 2m12s
AS Talange CI/CD Pipeline - Production / Deploy to Prod Environment (push) Successful in 3m7s
2026-08-27 23:07:55 +02:00
6 changed files with 12 additions and 101 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
{ {
"java.compile.nullAnalysis.mode": "automatic" "java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "interactive"
} }
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>as-talange-parent</artifactId> <artifactId>as-talange-parent</artifactId>
<groupId>com.astalange</groupId> <groupId>com.astalange</groupId>
<version>1.9-SNAPSHOT</version> <version>1.8</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>as-talange-parent</artifactId> <artifactId>as-talange-parent</artifactId>
<groupId>com.astalange</groupId> <groupId>com.astalange</groupId>
<version>1.9-SNAPSHOT</version> <version>1.8</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>as-talange-parent</artifactId> <artifactId>as-talange-parent</artifactId>
<groupId>com.astalange</groupId> <groupId>com.astalange</groupId>
<version>1.9-SNAPSHOT</version> <version>1.8</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -13,7 +13,7 @@
<groupId>com.astalange</groupId> <groupId>com.astalange</groupId>
<artifactId>as-talange-parent</artifactId> <artifactId>as-talange-parent</artifactId>
<version>1.9-SNAPSHOT</version> <version>1.8</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>as-talange-parent</name> <name>as-talange-parent</name>
+6 -96
View File
@@ -31,14 +31,6 @@ DB_HOST="${POSTGRES_HOST:-localhost}"
DB_PORT="${POSTGRES_PORT:-5432}" DB_PORT="${POSTGRES_PORT:-5432}"
CONTAINER_NAME="${DOCKER_CONTAINER_NAME:-astalange_db}" CONTAINER_NAME="${DOCKER_CONTAINER_NAME:-astalange_db}"
# Variables UAT
ENABLE_UAT_RESTORE="${ENABLE_UAT_RESTORE:-true}"
UAT_DB_HOST="${UAT_DB_HOST:-10.8.0.2}"
UAT_DB_PORT="${UAT_DB_PORT:-5433}"
UAT_DB_NAME="${UAT_DB_NAME:-astalange}"
UAT_DB_USER="${UAT_DB_USER:-myuser}"
UAT_DB_PASSWORD="${UAT_DB_PASSWORD:-mypassword}"
# Configuration du transfert distant vers le VPS (optionnel) # Configuration du transfert distant vers le VPS (optionnel)
ENABLE_REMOTE_COPY="${ENABLE_REMOTE_COPY:-false}" ENABLE_REMOTE_COPY="${ENABLE_REMOTE_COPY:-false}"
REMOTE_HOST="${REMOTE_HOST:-}" REMOTE_HOST="${REMOTE_HOST:-}"
@@ -88,106 +80,24 @@ if [ "$STATUS" = "SUCCESS" ]; then
# Vérification si le conteneur Docker est actif # Vérification si le conteneur Docker est actif
if command -v docker >/dev/null 2>&1 && docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then if command -v docker >/dev/null 2>&1 && docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
log "Mode détection: Conteneur Docker '${CONTAINER_NAME}' trouvé. Utilisation de pg_dump via docker exec." log "Mode détection: Conteneur Docker '${CONTAINER_NAME}' trouvé. Utilisation de pg_dump via docker exec."
docker exec -e PGPASSWORD="${DB_PASSWORD}" "${CONTAINER_NAME}" pg_dump --no-owner --no-privileges -U "${DB_USER}" -d "${DB_NAME}" | gzip > "$DUMP_PATH" 2>> "$LOG_FILE" docker exec -e PGPASSWORD="${DB_PASSWORD}" "${CONTAINER_NAME}" pg_dump -U "${DB_USER}" -d "${DB_NAME}" | gzip > "$DUMP_PATH" 2>> "$LOG_FILE"
DUMP_EXIT_CODE=${PIPESTATUS[0]} DUMP_EXIT_CODE=${PIPESTATUS[0]}
else else
log "Mode détection: Exécution directe de pg_dump (hôte local)." log "Mode détection: Exécution directe de pg_dump (hôte local)."
PGPASSWORD="${DB_PASSWORD}" pg_dump --no-owner --no-privileges -h "${DB_HOST}" -p "${DB_PORT}" -U "${DB_USER}" -d "${DB_NAME}" | gzip > "$DUMP_PATH" 2>> "$LOG_FILE" PGPASSWORD="${DB_PASSWORD}" pg_dump -h "${DB_HOST}" -p "${DB_PORT}" -U "${DB_USER}" -d "${DB_NAME}" | gzip > "$DUMP_PATH" 2>> "$LOG_FILE"
DUMP_EXIT_CODE=${PIPESTATUS[0]} DUMP_EXIT_CODE=${PIPESTATUS[0]}
fi fi
if [ ${DUMP_EXIT_CODE} -eq 0 ] || [ ${DUMP_EXIT_CODE} -eq 141 ]; then if [ ${DUMP_EXIT_CODE} -eq 0 ] && [ -s "$DUMP_PATH" ]; then
if [ -s "$DUMP_PATH" ]; then DUMP_SIZE=$(du -h "$DUMP_PATH" | cut -f1)
DUMP_SIZE=$(du -h "$DUMP_PATH" | cut -f1) log "✅ Dump généré avec succès ! Taille du fichier : ${DUMP_SIZE}"
log "✅ Dump généré avec succès ! Taille du fichier : ${DUMP_SIZE}" else
DUMP_EXIT_CODE=0
fi
fi
if [ ${DUMP_EXIT_CODE} -ne 0 ]; then
log "❌ ERREUR lors de l'extraction de la base de données (code de sortie: ${DUMP_EXIT_CODE})." log "❌ ERREUR lors de l'extraction de la base de données (code de sortie: ${DUMP_EXIT_CODE})."
STATUS="FAILURE" STATUS="FAILURE"
rm -f "$DUMP_PATH" rm -f "$DUMP_PATH"
fi fi
fi fi
# 2b. Restauration et Anonymisation vers la BDD UAT (10.8.0.2)
if [ "$STATUS" = "SUCCESS" ] && [ "$ENABLE_UAT_RESTORE" = "true" ]; then
log "Démarrage de la restauration et l'anonymisation sur UAT (${UAT_DB_USER}@${UAT_DB_HOST}:${UAT_DB_PORT}/${UAT_DB_NAME})..."
CLEAN_SCHEMA_SQL="
DO \$\$ DECLARE r RECORD; BEGIN FOR r IN (SELECT oid FROM pg_largeobject_metadata) LOOP PERFORM lo_unlink(r.oid); END LOOP; EXCEPTION WHEN OTHERS THEN NULL; END \$\$;
DROP SCHEMA IF EXISTS public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO ${UAT_DB_USER};
GRANT ALL ON SCHEMA public TO public;
"
ANONYMIZE_SQL="
UPDATE adherent SET
nom = 'Nom_Adherent_' || id,
prenom = 'Prenom_Adherent_' || id,
email = 'adherent' || id || '@test.local',
telephone = '06' || LPAD((id)::text, 8, '0'),
lieu_naissance_ville = 'Ville_' || id,
representant_legal = CASE
WHEN representant_legal IS NOT NULL AND TRIM(representant_legal) <> ''
THEN 'Representant_' || id
ELSE representant_legal
END;
UPDATE pre_inscription SET
nom = 'Nom_PreInscr_' || id,
prenom = 'Prenom_PreInscr_' || id,
email = 'preinscr' || id || '@test.local',
telephone = '06' || LPAD((id)::text, 8, '0'),
lieu_naissance_ville = 'Ville_' || id,
representant_legal = CASE
WHEN representant_legal IS NOT NULL AND TRIM(representant_legal) <> ''
THEN 'Representant_PreInscr_' || id
ELSE representant_legal
END;
UPDATE educateur SET
nom = 'Nom_Educ_' || id,
prenom = 'Prenom_Educ_' || id,
email = 'educ' || id || '@test.local',
telephone = '06' || LPAD((id)::text, 8, '0');
"
RESTORE_SUCCESS=false
if command -v psql >/dev/null 2>&1; then
log "Réinitialisation du schéma public sur UAT..."
PGPASSWORD="${UAT_DB_PASSWORD}" psql -h "${UAT_DB_HOST}" -p "${UAT_DB_PORT}" -U "${UAT_DB_USER}" -d "${UAT_DB_NAME}" -c "$CLEAN_SCHEMA_SQL" >> "$LOG_FILE" 2>&1
log "Restauration du dump Prod vers UAT..."
if gunzip -c "$DUMP_PATH" | PGPASSWORD="${UAT_DB_PASSWORD}" psql -h "${UAT_DB_HOST}" -p "${UAT_DB_PORT}" -U "${UAT_DB_USER}" -d "${UAT_DB_NAME}" >> "$LOG_FILE" 2>&1; then
log "Exécution des requêtes d'anonymisation sur UAT..."
if PGPASSWORD="${UAT_DB_PASSWORD}" psql -h "${UAT_DB_HOST}" -p "${UAT_DB_PORT}" -U "${UAT_DB_USER}" -d "${UAT_DB_NAME}" -c "$ANONYMIZE_SQL" >> "$LOG_FILE" 2>&1; then
RESTORE_SUCCESS=true
fi
fi
elif command -v docker >/dev/null 2>&1; then
log "Réinitialisation du schéma public sur UAT via Docker..."
docker run --rm --net=host -e PGPASSWORD="${UAT_DB_PASSWORD}" postgres:15-alpine psql -h "${UAT_DB_HOST}" -p "${UAT_DB_PORT}" -U "${UAT_DB_USER}" -d "${UAT_DB_NAME}" -c "$CLEAN_SCHEMA_SQL" >> "$LOG_FILE" 2>&1
log "Restauration du dump Prod vers UAT via Docker..."
if gunzip -c "$DUMP_PATH" | docker run --rm -i --net=host -e PGPASSWORD="${UAT_DB_PASSWORD}" postgres:15-alpine psql -h "${UAT_DB_HOST}" -p "${UAT_DB_PORT}" -U "${UAT_DB_USER}" -d "${UAT_DB_NAME}" >> "$LOG_FILE" 2>&1; then
log "Exécution des requêtes d'anonymisation sur UAT via Docker..."
if docker run --rm --net=host -e PGPASSWORD="${UAT_DB_PASSWORD}" postgres:15-alpine psql -h "${UAT_DB_HOST}" -p "${UAT_DB_PORT}" -U "${UAT_DB_USER}" -d "${UAT_DB_NAME}" -c "$ANONYMIZE_SQL" >> "$LOG_FILE" 2>&1; then
RESTORE_SUCCESS=true
fi
fi
fi
if [ "$RESTORE_SUCCESS" = "true" ]; then
log "✅ Restauration et anonymisation UAT réussies avec succès !"
else
log "⚠️ AVERTISSEMENT: Impossible d'effectuer la restauration/anonymisation UAT."
fi
fi
# 3. Transfert sécurisé RSYNC / SCP vers le serveur VPS (Optionnel) # 3. Transfert sécurisé RSYNC / SCP vers le serveur VPS (Optionnel)
if [ "$STATUS" = "SUCCESS" ] && [ "$ENABLE_REMOTE_COPY" = "true" ] && [ -n "$REMOTE_HOST" ]; then if [ "$STATUS" = "SUCCESS" ] && [ "$ENABLE_REMOTE_COPY" = "true" ] && [ -n "$REMOTE_HOST" ]; then
log "Transfert du dump vers le serveur VPS distant (${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_BACKUP_DIR})..." log "Transfert du dump vers le serveur VPS distant (${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_BACKUP_DIR})..."