29 Commits
Author SHA1 Message Date
ucef 645d07fdfc feat(backup): update DB UAT port
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m57s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m1s
2026-09-04 08:42:55 +02:00
ucef e1cffb8fc8 feat(backup): add automatic database restoration and RGPD anonymization for UAT environment (10.8.0.2) 2026-09-04 08:39:21 +02:00
ucef 3daef9b567 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 / Build & Run Unit Tests (push) Successful in 4m50s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m14s
2026-09-04 08:10:08 +02:00
ucef d987b9e46c fix(ci): execute deployment directly in runner step environment without nested container 2026-09-04 08:03:23 +02:00
ucef c5a4ae9498 fix(ci): use GITHUB_WORKSPACE for repository volume mount and absolute path /workspace/ for rsync 2026-09-04 07:26:53 +02:00
ucef 3354f3ee70 fix(ci): re-wrap PEM payload to 64 chars with explicit trailing newline 2026-09-04 07:18:12 +02:00
ucef dae97f15ba fix(ci): validate SSH key header format and provide explicit guidance for Gitea secret value 2026-09-04 07:04:21 +02:00
ucef 37611dc79f fix(ci): handle file paths in RAW_KEY and add key line count diagnostic logs 2026-09-03 15:55:13 +02:00
ucef ab63a8a913 fix(ci): pass SSH key as base64 environment variable to completely eliminate volume mount issues 2026-09-03 15:47:40 +02:00
ucef a4186ab4d3 fix(ci): strict regular file check and explicit error message when PROD_DB_SSH_KEY is missing 2026-09-03 15:39:35 +02:00
ucef 1231947e2b fix(ci): write secret key to runner file before docker run to preserve multi-line format 2026-09-03 15:26:22 +02:00
ucef 7450ea07ab fix(ci): use PROD_DB_SSH_KEY Gitea secret for reliable cross-runner authentication 2026-09-03 15:19:28 +02:00
ucef 22d8f5aea1 security: replace key header log with safe public ssh-keygen fingerprint display 2026-09-03 15:11:16 +02:00
ucef e70bf08fe9 ci: add comprehensive diagnostic logs and ssh -vv trace to step 2026-09-03 15:09:07 +02:00
ucef 748d86e71c fix(ci): mount /home/ucef/.ssh and prioritize gitea_ci_key over generic host keys 2026-09-03 15:02:09 +02:00
ucef 75611d147c fix(ci): copy key to /tmp/id_rsa instead of ~/.ssh/id_rsa to avoid read-only mount error 2026-09-03 14:56:31 +02:00
ucef e6de9836fc fix(ci): robust SSH key resolution supporting both file paths and Gitea secrets 2026-09-03 14:49:33 +02:00
ucef c198368c19 refactor(ci): simplify SSH step to directly copy and use /root/.ssh/gitea_ci_key with 600 permissions
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m51s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m7s
2026-09-03 14:40:44 +02:00
ucef 390c547920 fix(ci): prioritize /root/.ssh/gitea_ci_key mount
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m56s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m23s
2026-09-03 14:29:20 +02:00
ucef 2d390b553d fix(ci): mount /home/ubuntu/.ssh and auto-detect gitea_ci_key location 2026-09-03 14:26:53 +02:00
ucef 801fbd359d fix(ci): add UserKnownHostsFile=/dev/null and target gitea_ci_key to fix read-only ssh error
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 5m1s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m2s
2026-09-03 14:05:44 +02:00
ucef af47025893 refactor(ci): mount host .ssh directory directly in docker step container
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m48s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 1m53s
2026-09-03 13:16:03 +02:00
ucef b05a490040 fix(ci): strip carriage returns from SSH key and force IdentitiesOnly=yes to fix libcrypto unsupported error
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 5m11s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m3s
2026-09-03 12:59:24 +02:00
ucef ced7c9ce38 fix(ci): run rsync DB script deployment with host network (--net=host) to fix VPN timeout
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 5m8s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m13s
2026-09-03 12:51:10 +02:00
ucef 4687bc8d2b fix(ci): preserve SSH key linebreaks with printf and add custom port support
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m45s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m8s
2026-09-03 10:04:34 +02:00
ucef 0d3270e852 fix(ci): check all SSH key secret variants and force rsync deployment to DB server
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 5m0s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m18s
2026-09-03 08:03:03 +02:00
ucef 3e9daef770 feat(ci): add step to deploy backup script and env to DB server (10.8.0.3) via rsync
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m55s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m10s
2026-09-03 07:54:18 +02:00
ucef 86ddad513d feat(backup): add automated DB backup script, rsync support and Gitea CI secret integration
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m55s
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 6m14s
2026-09-03 07:46:56 +02:00
ucef 8fa4437864 chore: bump version to 1.9-SNAPSHOT 2026-08-27 23:23:39 +02:00
6 changed files with 15 additions and 35 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "interactive"
"java.compile.nullAnalysis.mode": "automatic"
}
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>as-talange-parent</artifactId>
<groupId>com.astalange</groupId>
<version>1.8</version>
<version>1.9-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>as-talange-parent</artifactId>
<groupId>com.astalange</groupId>
<version>1.8</version>
<version>1.9-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>as-talange-parent</artifactId>
<groupId>com.astalange</groupId>
<version>1.8</version>
<version>1.9-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -13,7 +13,7 @@
<groupId>com.astalange</groupId>
<artifactId>as-talange-parent</artifactId>
<version>1.8</version>
<version>1.9-SNAPSHOT</version>
<packaging>pom</packaging>
<name>as-talange-parent</name>
+10 -29
View File
@@ -88,23 +88,18 @@ if [ "$STATUS" = "SUCCESS" ]; then
# 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
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]}
else
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]}
fi
if [ ${DUMP_EXIT_CODE} -eq 0 ] || [ ${DUMP_EXIT_CODE} -eq 141 ]; then
if [ -s "$DUMP_PATH" ]; then
DUMP_SIZE=$(du -h "$DUMP_PATH" | cut -f1)
log "✅ Dump généré avec succès ! Taille du fichier : ${DUMP_SIZE}"
DUMP_EXIT_CODE=0
fi
fi
if [ ${DUMP_EXIT_CODE} -ne 0 ]; then
if [ ${DUMP_EXIT_CODE} -eq 0 ] && [ -s "$DUMP_PATH" ]; then
DUMP_SIZE=$(du -h "$DUMP_PATH" | cut -f1)
log "✅ Dump généré avec succès ! Taille du fichier : ${DUMP_SIZE}"
else
log "❌ ERREUR lors de l'extraction de la base de données (code de sortie: ${DUMP_EXIT_CODE})."
STATUS="FAILURE"
rm -f "$DUMP_PATH"
@@ -115,21 +110,13 @@ fi
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,
lieu_naissance = 'Ville_' || id,
representant_legal = CASE
WHEN representant_legal IS NOT NULL AND TRIM(representant_legal) <> ''
THEN 'Representant_' || id
@@ -141,7 +128,7 @@ UPDATE pre_inscription SET
prenom = 'Prenom_PreInscr_' || id,
email = 'preinscr' || id || '@test.local',
telephone = '06' || LPAD((id)::text, 8, '0'),
lieu_naissance_ville = 'Ville_' || id,
lieu_naissance = 'Ville_' || id,
representant_legal = CASE
WHEN representant_legal IS NOT NULL AND TRIM(representant_legal) <> ''
THEN 'Representant_PreInscr_' || id
@@ -158,10 +145,7 @@ UPDATE educateur SET
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..."
log "Restauration UAT via psql local..."
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
@@ -169,10 +153,7 @@ UPDATE educateur SET
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..."
log "Restauration UAT via conteneur Docker postgres..."
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