Fix Jenkinsfile syntax (clean comments)
This commit is contained in:
parent
cf4809be39
commit
91802b178b
24
Jenkinsfile
vendored
24
Jenkinsfile
vendored
|
|
@ -100,29 +100,7 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Health Check') {
|
||||
steps {
|
||||
echo "🩺 Vérification de l’état du backend..."
|
||||
script {
|
||||
def domain = (env.ENV == 'dev') ? "api.dev.dsp5-archi-o24a-15m-g3.fr" :
|
||||
(env.ENV == 'preprod') ? "api.preprod.dsp5-archi-o24a-15m-g3.fr" :
|
||||
"api.dsp5-archi-o24a-15m-g3.fr"
|
||||
|
||||
def statusCode = "000"
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
statusCode = sh(script: "curl -k -s -o /dev/null -w '%{http_code}' https://${domain}/health || echo 000", returnStdout: true).trim()
|
||||
if (statusCode in ['200', '301', '302']) {
|
||||
echo "✅ Backend ${env.ENV} opérationnel (HTTP ${statusCode})"
|
||||
return
|
||||
}
|
||||
|
||||
echo "⏳ Tentative ${i}/10 → HTTP ${statusCode}"
|
||||
sleep 5
|
||||
}
|
||||
error("❌ Health check échoué - code HTTP ${statusCode}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
post {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user