From 1b9420dfd6b10cb7bc3de7d9bcd6f7f01c7a8bc4 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 18 Sep 2024 10:52:35 +0100 Subject: [PATCH] Added SonarQube quality gate to the Jenkinsfile --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index eea1f366..0597fc84 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,4 @@ +// This adds a quality gate that aborts the pipeline if the quality threshold isn't met pipeline { agent any @@ -15,8 +16,11 @@ pipeline { steps { withSonarQubeEnv('sonar-qube-1') { sh "${scannerHome}/bin/sonar-scanner" - } + } + timeout(time: 10, unit: 'MINUTES'){ + waitForQualityGate abortPipeline: true } } } +} } \ No newline at end of file