From dce437b82e8f82f9f1348867f2aaac163a3bbc1a Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 19 Dec 2019 11:01:12 +0100 Subject: [PATCH] do not mark build as unstable if iqserver is not able to analyze --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c759de5733..37cbdb4064 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,7 +55,13 @@ node('docker') { if (isMainBranch()) { stage('Lifecycle') { - nexusPolicyEvaluation iqApplication: selectedApplication('scm'), iqScanPatterns: [[scanPattern: 'scm-server/target/scm-server-app.zip']], iqStage: 'build' + try { + // failBuildOnNetworkError -> so we can catch the exception and neither fail nor make our build unstable + nexusPolicyEvaluation iqApplication: selectedApplication('scm'), iqScanPatterns: [[scanPattern: 'scm-server/target/scm-server-app.zip']], iqStage: 'build', failBuildOnNetworkError: true + } catch (Exception e) { + echo "ERROR: iQ Server policy eval failed. Not marking build unstable for now." + echo "ERROR: iQ Server Exception: ${e.getMessage()}" + } } stage('Archive') {