From 1040f7272f9e96ad4c83a5179a7372accd1fe762 Mon Sep 17 00:00:00 2001 From: syoul Date: Tue, 17 Mar 2026 19:10:45 +0100 Subject: [PATCH] fix: healthcheck evite substitution Woodpecker (SITE au lieu de PS_DOMAIN) --- .woodpecker.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 3ea84da..8d9969a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -74,20 +74,20 @@ steps: commands: - apk add --no-cache --quiet curl - | - PS_DOMAIN=$(grep '^PS_DOMAIN=' .env.deploy | cut -d= -f2) - if [ -z "${PS_DOMAIN}" ]; then + SITE=$(grep '^PS_DOMAIN=' .env.deploy | cut -d= -f2) + if [ -z "$SITE" ]; then echo "ERREUR: PS_DOMAIN non defini dans .env.deploy" exit 1 fi - TARGET="http://${PS_DOMAIN}" - echo "Healthcheck sur ${TARGET} (max 10 minutes)..." + TARGET="http://$SITE" + echo "Healthcheck sur $TARGET (max 10 minutes)..." MAX=60 i=0 until [ $i -ge $MAX ]; do - HTTP_CODE=$(curl -sSo /dev/null -w "%{http_code}" "${TARGET}" 2>/dev/null) - echo "Tentative $((i+1))/${MAX} - HTTP ${HTTP_CODE}" - if [ "${HTTP_CODE}" = "200" ] || [ "${HTTP_CODE}" = "301" ] || [ "${HTTP_CODE}" = "302" ]; then - echo "PrestaShop repond correctement sur ${TARGET}" + CODE=$(curl -sSo /dev/null -w "%{http_code}" "$TARGET" 2>/dev/null) + echo "Tentative $((i+1))/$MAX - HTTP $CODE" + if [ "$CODE" = "200" ] || [ "$CODE" = "301" ] || [ "$CODE" = "302" ]; then + echo "PrestaShop repond correctement sur $TARGET" exit 0 fi i=$((i+1))