From 7192298b25166a3c9064b5fc4ee2f68f11bcc3d6 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Wed, 8 Jun 2022 09:36:12 +0200
Subject: [PATCH] build pluto with all services in single step

---
 Jenkinsfile | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 52 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index ca8ab5d21..71a02b024 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -52,7 +52,35 @@ pipeline {
                 }
             }
         }
-        stage('Build Pluto-Interface') {
+        
+        stage('Build Pluto / NachrichtenManagner') {
+          steps {
+                script {
+                    FAILED_STAGE=env.STAGE_NAME
+                }
+                container("maven-17"){
+                    sh 'mvn --version'
+                    configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
+                            sh 'mvn -s $MAVEN_SETTINGS clean install -Dmaven.wagon.http.retryHandler.count=3'
+                            
+                            script {
+	                        	try {
+		                            if (env.BRANCH_NAME == 'master') {
+	    	                            withSonarQubeEnv('sonarqube-ozg-sh'){
+	        	                            sh 'mvn -s $MAVEN_SETTINGS sonar:sonar'
+	            	                    }
+	            	             	}
+	                            } catch (Exception e) {
+	                                unstable("SonarQube failed")
+	                            }
+                        	}
+                        }
+                }                       
+                 
+           }            
+         }
+        
+    /*    stage('Build Pluto-Interface') {
             steps {
                 script {
                     FAILED_STAGE=env.STAGE_NAME
@@ -77,10 +105,31 @@ pipeline {
                         }
                     }
                 }
+            
+            }
+        }*/
+        
+        stage('Deploy to Nexus'){
+            when {
+                anyOf {
+                    branch 'master'
+                    branch 'release'
+                }
+            }
+            steps {
+                script {
+                    FAILED_STAGE = env.STAGE_NAME
+                }
+                container('maven-17') {
+                        configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
+                            sh 'mvn -s $MAVEN_SETTINGS -DskipTests clean deploy'
+                        }
+
+                }
             }
         }
 
-        stage('Deploy Pluto-Interface to Nexus'){
+    /*    stage('Deploy Pluto-Interface to Nexus'){
             when {
                 anyOf {
                     branch 'master'
@@ -197,7 +246,7 @@ pipeline {
                     }
                 }
             }
-        }
+        }*/
         
         
 
-- 
GitLab