From becb1b46664ccd34ecefdd18b81b43e3a2e558e2 Mon Sep 17 00:00:00 2001 From: syoul Date: Tue, 17 Mar 2026 21:59:01 +0100 Subject: [PATCH] fix: acme.sh exit code capture avec set -e ; ACME_EXIT=$? ne fonctionnait que si acme.sh retournait 0 (premier lancement). Avec exit 2 (skip/cert valide), set -e coupait le script avant la capture. Correction : ACME_EXIT=0 + || ACME_EXIT=$? Co-Authored-By: Claude Sonnet 4.6 --- .woodpecker.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 442b2ba..15fe260 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -84,12 +84,15 @@ steps: # acme.sh est idempotent : skip si cert valide, renouvelle si proche expiration # Exit 0 = emis/renouvele, exit 2 = skip (domaine inchange), autres = erreur # --home /etc/acme.sh = volume persistant sonic_acme (sinon /root/.acme.sh non persiste) + # ; ACME_EXIT=$? ne fonctionne pas avec set -e (shell quitte si exit != 0 avant la capture) + # || ACME_EXIT=$? capture le code sans declencher set -e + ACME_EXIT=0 docker exec sonic-acme-1 /app/acme.sh \ --home /etc/acme.sh \ --issue -d "$DOMAIN" \ --webroot /usr/share/nginx/html \ --server letsencrypt \ - --accountemail support+acme@asycn.io; ACME_EXIT=$? + --accountemail support+acme@asycn.io || ACME_EXIT=$? if [ "$ACME_EXIT" -ne 0 ] && [ "$ACME_EXIT" -ne 2 ]; then echo "ERREUR: acme.sh a echoue (exit $ACME_EXIT)" exit 1