fix: healthcheck evite substitution Woodpecker (SITE au lieu de PS_DOMAIN)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
syoul
2026-03-17 19:10:45 +01:00
parent 380d0cf7d1
commit 1040f7272f

View File

@@ -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))