From 4d76c8466432beaf67add9a77f3f20e4b764b705 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Wed, 29 May 2024 17:03:09 +0200
Subject: [PATCH] OZG-5271 OZG-5782 Jenkins: run unit tests first, build second

No need for building if unit tests are failing.
---
 Jenkinsfile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 6bea0018e3..ef44d538b0 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -58,15 +58,9 @@ pipeline {
                         sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc'
                         sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczprTSFnNVUhMVQzNDZxWQ==" >> ~/.npmrc'
 
-						sh 'npm cache verify'
+						            sh 'npm cache verify'
                         sh 'npm install'
 
-                        if (isReleaseBranch()) {
-                            sh 'npm run ci-prodBuild'
-                        }
-                        else {
-                            sh 'npm run ci-build'
-                        }
                         if (isMasterBranch()) {
                             withSonarQubeEnv('sonarqube-ozg-sh'){
                                 sh 'npm run ci-sonar'
@@ -74,6 +68,12 @@ pipeline {
                         } else {
                             sh 'npm run ci-test'
                         }
+                        if (isReleaseBranch()) {
+                            sh 'npm run ci-prodBuild'
+                        }
+                        else {
+                            sh 'npm run ci-build'
+                        }
                     }
                 }
             }
-- 
GitLab