From 2f161ab2320c7ae72a299444235ec21243c59615 Mon Sep 17 00:00:00 2001 From: Anupong Hompan Date: Mon, 27 Oct 2025 22:59:05 +0700 Subject: [PATCH] JK --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c8cad51..a9b23d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -155,9 +155,11 @@ pipeline { steps { // Wait for the Quality Gate result and fail fast on non-green outcomes. timeout(time: 15, unit: 'MINUTES') { - def qualityGate = waitForQualityGate() - if (qualityGate.status != 'OK') { - error "SonarQube Quality Gate failed: ${qualityGate.status}" + script { + def qualityGate = waitForQualityGate() + if (qualityGate.status != 'OK') { + error "SonarQube Quality Gate failed: ${qualityGate.status}" + } } } }