From 91802b178b7601113a9df168085497dd31aab1cb Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 4 Nov 2025 15:38:00 +0100 Subject: [PATCH] Fix Jenkinsfile syntax (clean comments) --- Jenkinsfile | 24 +----------------------- index.js | 3 --- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 87218ac5..56fdf615 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 { diff --git a/index.js b/index.js index 9925edb3..4b62dcb7 100644 --- a/index.js +++ b/index.js @@ -19,9 +19,6 @@ app.use(helmet()); app.use(morgan("tiny")); app.use(express.json()); -app.get("/health", (req, res) => { - res.status(200).json({ status: "ok" }); -}); // ✅ Route racine (pour test ou monitoring) app.get("/", (req, res) => {