fix: healthcheck evite substitution Woodpecker (SITE au lieu de PS_DOMAIN)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -74,20 +74,20 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- apk add --no-cache --quiet curl
|
- apk add --no-cache --quiet curl
|
||||||
- |
|
- |
|
||||||
PS_DOMAIN=$(grep '^PS_DOMAIN=' .env.deploy | cut -d= -f2)
|
SITE=$(grep '^PS_DOMAIN=' .env.deploy | cut -d= -f2)
|
||||||
if [ -z "${PS_DOMAIN}" ]; then
|
if [ -z "$SITE" ]; then
|
||||||
echo "ERREUR: PS_DOMAIN non defini dans .env.deploy"
|
echo "ERREUR: PS_DOMAIN non defini dans .env.deploy"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
TARGET="http://${PS_DOMAIN}"
|
TARGET="http://$SITE"
|
||||||
echo "Healthcheck sur ${TARGET} (max 10 minutes)..."
|
echo "Healthcheck sur $TARGET (max 10 minutes)..."
|
||||||
MAX=60
|
MAX=60
|
||||||
i=0
|
i=0
|
||||||
until [ $i -ge $MAX ]; do
|
until [ $i -ge $MAX ]; do
|
||||||
HTTP_CODE=$(curl -sSo /dev/null -w "%{http_code}" "${TARGET}" 2>/dev/null)
|
CODE=$(curl -sSo /dev/null -w "%{http_code}" "$TARGET" 2>/dev/null)
|
||||||
echo "Tentative $((i+1))/${MAX} - HTTP ${HTTP_CODE}"
|
echo "Tentative $((i+1))/$MAX - HTTP $CODE"
|
||||||
if [ "${HTTP_CODE}" = "200" ] || [ "${HTTP_CODE}" = "301" ] || [ "${HTTP_CODE}" = "302" ]; then
|
if [ "$CODE" = "200" ] || [ "$CODE" = "301" ] || [ "$CODE" = "302" ]; then
|
||||||
echo "PrestaShop repond correctement sur ${TARGET}"
|
echo "PrestaShop repond correctement sur $TARGET"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
|
|||||||
Reference in New Issue
Block a user