Mise à jour de index.js
This commit is contained in:
parent
559f31b190
commit
f2afdaaff7
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
|
|
@ -166,11 +166,19 @@ pipeline {
|
||||||
|
|
||||||
def statusCode = "000"
|
def statusCode = "000"
|
||||||
for (int i = 1; i <= 10; i++) {
|
for (int i = 1; i <= 10; i++) {
|
||||||
|
// 🔍 Essaie d'abord /health
|
||||||
statusCode = sh(script: "curl -k -s -o /dev/null -w '%{http_code}' https://${domain}/health || echo 000", returnStdout: true).trim()
|
statusCode = sh(script: "curl -k -s -o /dev/null -w '%{http_code}' https://${domain}/health || echo 000", returnStdout: true).trim()
|
||||||
if (statusCode in ['200']) {
|
|
||||||
|
// 🔁 Si /health renvoie 404, teste /
|
||||||
|
if (statusCode == '404') {
|
||||||
|
statusCode = sh(script: "curl -k -s -o /dev/null -w '%{http_code}' https://${domain}/ || echo 000", returnStdout: true).trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statusCode in ['200', '301', '302']) {
|
||||||
echo "✅ Backend ${env.ENV} opérationnel (HTTP ${statusCode})"
|
echo "✅ Backend ${env.ENV} opérationnel (HTTP ${statusCode})"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "⏳ Tentative ${i}/10 → HTTP ${statusCode}"
|
echo "⏳ Tentative ${i}/10 → HTTP ${statusCode}"
|
||||||
sleep 5
|
sleep 5
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user