From c92d3e1b853c5a10427996e446259d0400c063e4 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Fri, 25 Mar 2022 17:35:31 +0530 Subject: [PATCH 01/14] updated jenkins --- jenkins | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 jenkins diff --git a/jenkins b/jenkins new file mode 100644 index 000000000..e69de29bb From c90c115dd9b82a70502bb0b6a38ef482560f4162 Mon Sep 17 00:00:00 2001 From: kallepallinaveen <95407045+kallepallinaveen@users.noreply.github.com> Date: Fri, 25 Mar 2022 17:37:32 +0530 Subject: [PATCH 02/14] Update jenkins --- jenkins | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/jenkins b/jenkins index e69de29bb..66c205450 100644 --- a/jenkins +++ b/jenkins @@ -0,0 +1,26 @@ +pipeline{ + agent any + stages{ + stage("git code"){ + steps{ + git_repo:"https://github.com/kallepallinaveen/spring-framework-petclinic.gitt", branch:"master" + } + + } + stage("build code"){ + steps{ + sh "mvn clean install" + + } + + } + stage("test code"){ + steps{ + sh "mvn test" + + } + + } + + } +} From 9aeddaf9a49fce3cf78c1371abd97675e2f59072 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Fri, 25 Mar 2022 17:43:59 +0530 Subject: [PATCH 03/14] updated --- jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins b/jenkins index 66c205450..f9ee18059 100644 --- a/jenkins +++ b/jenkins @@ -3,7 +3,7 @@ pipeline{ stages{ stage("git code"){ steps{ - git_repo:"https://github.com/kallepallinaveen/spring-framework-petclinic.gitt", branch:"master" + git_repo:"https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"master" } } From 366abc26408a6ed5b100135f69399c227dcc78e7 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Fri, 25 Mar 2022 17:52:50 +0530 Subject: [PATCH 04/14] jenkins branch --- spring-framework-petclinic | 1 + 1 file changed, 1 insertion(+) create mode 160000 spring-framework-petclinic diff --git a/spring-framework-petclinic b/spring-framework-petclinic new file mode 160000 index 000000000..9aeddaf9a --- /dev/null +++ b/spring-framework-petclinic @@ -0,0 +1 @@ +Subproject commit 9aeddaf9a49fce3cf78c1371abd97675e2f59072 From cf2a94afdb9edb44affba180280393cbc2854b16 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Fri, 25 Mar 2022 17:58:30 +0530 Subject: [PATCH 05/14] modified jenkins file --- jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins b/jenkins index f9ee18059..f41baabd5 100644 --- a/jenkins +++ b/jenkins @@ -3,7 +3,7 @@ pipeline{ stages{ stage("git code"){ steps{ - git_repo:"https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"master" + git_repo: "https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"prod" } } From 7c4db4ae3125b69f53cedde2b691b55d439da089 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Fri, 25 Mar 2022 18:00:46 +0530 Subject: [PATCH 06/14] updated jenkins --- jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins b/jenkins index f41baabd5..80629831b 100644 --- a/jenkins +++ b/jenkins @@ -3,7 +3,7 @@ pipeline{ stages{ stage("git code"){ steps{ - git_repo: "https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"prod" + git_url: "https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"prod" } } From 5382e2de91a3331c43c873a7eac546de1c587287 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Fri, 25 Mar 2022 18:02:48 +0530 Subject: [PATCH 07/14] jenkins updated --- jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins b/jenkins index 80629831b..39760f7ee 100644 --- a/jenkins +++ b/jenkins @@ -3,7 +3,7 @@ pipeline{ stages{ stage("git code"){ steps{ - git_url: "https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"prod" + git url: "https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"prod" } } From 547a85eec1cfc1ef224b315d99c312949320e6fe Mon Sep 17 00:00:00 2001 From: kallepalli Date: Sat, 26 Mar 2022 13:17:08 +0530 Subject: [PATCH 08/14] updated sonarqube --- jenkins | 20 ++++++++++++++++++++ sonar.properties | 14 ++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 sonar.properties diff --git a/jenkins b/jenkins index 39760f7ee..431eb72d0 100644 --- a/jenkins +++ b/jenkins @@ -21,6 +21,26 @@ pipeline{ } } + stage('Sonarqube Analysis') { + environment { + def scannerHome = tool 'SonarQube Scanner 2.4' + } + steps { + withSonarQubeEnv('sonarqube-scanner'){ + sh + } + + + } + sleep time: 30000, unit: 'MILLISECONDS' + script { + def qg = waitForQualityGate() + if (qg.status != 'OK') { + error "Pipeline aborted due to quality gate failure: ${qg.status}" + } + } + } + } } } diff --git a/sonar.properties b/sonar.properties new file mode 100644 index 000000000..c27b3d935 --- /dev/null +++ b/sonar.properties @@ -0,0 +1,14 @@ +# must be unique in a given SonarQube instance +sonar.projectKey=sonar-scanning-examples +# --- optional properties --- +# defaults to project key +sonar.projectName=Naveen-pet-clinic-app +# defaults to 'not provided' +sonar.projectVersion=1.0 +# Path is relative to the sonar-project.properties file. Defaults to . +sonar.sources=. +# Encoding of the source code. Default is default system encoding +sonar.sourceEncoding=UTF-8 +sonar.host.url=http://7ba2808d972d.mylabserver.com:8000 +sonar.java.binaries=./target/classes +sonar.login=a9401dc2d990013650b395a3d845fe7fede92e59 \ No newline at end of file From 909820047f4bdf30ff3224fba8d65f0b6452dce9 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Sat, 26 Mar 2022 13:20:42 +0530 Subject: [PATCH 09/14] updated --- jenkins | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jenkins b/jenkins index 431eb72d0..16076739c 100644 --- a/jenkins +++ b/jenkins @@ -27,10 +27,8 @@ pipeline{ } steps { withSonarQubeEnv('sonarqube-scanner'){ - sh + sh 'mvn clean package sonar:sonar' } - - } sleep time: 30000, unit: 'MILLISECONDS' script { From 1acd2d937c50f0de45a3c1e21d572407b8fdff26 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Sat, 26 Mar 2022 13:25:08 +0530 Subject: [PATCH 10/14] updated --- jenkins | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jenkins b/jenkins index 16076739c..7827b7d57 100644 --- a/jenkins +++ b/jenkins @@ -37,8 +37,6 @@ pipeline{ error "Pipeline aborted due to quality gate failure: ${qg.status}" } } - } - } - + } } } From 1b5f00128e6c99eeefccf64147549e6e8c942a6a Mon Sep 17 00:00:00 2001 From: kallepalli Date: Sat, 26 Mar 2022 13:27:04 +0530 Subject: [PATCH 11/14] updated --- jenkins | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins b/jenkins index 7827b7d57..5807f3308 100644 --- a/jenkins +++ b/jenkins @@ -21,7 +21,7 @@ pipeline{ } } - stage('Sonarqube Analysis') { + stage('Sonarqube Analysis'){ environment { def scannerHome = tool 'SonarQube Scanner 2.4' } @@ -37,6 +37,6 @@ pipeline{ error "Pipeline aborted due to quality gate failure: ${qg.status}" } } - } + } } } From 70061b6d6fe0445b53d141f03e96a7570f0b1a15 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Sat, 26 Mar 2022 13:33:35 +0530 Subject: [PATCH 12/14] updated --- jenkins | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins b/jenkins index 5807f3308..c78c45e35 100644 --- a/jenkins +++ b/jenkins @@ -28,9 +28,9 @@ pipeline{ steps { withSonarQubeEnv('sonarqube-scanner'){ sh 'mvn clean package sonar:sonar' - } } - sleep time: 30000, unit: 'MILLISECONDS' + } + sleep time: 30000, unit: 'MILLISECONDS' script { def qg = waitForQualityGate() if (qg.status != 'OK') { From 1ed9fa01bfa30db4f294ca53892e79d0a5f00b7c Mon Sep 17 00:00:00 2001 From: kallepalli Date: Sat, 26 Mar 2022 14:02:59 +0530 Subject: [PATCH 13/14] updated --- jenkins | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins b/jenkins index c78c45e35..d28591436 100644 --- a/jenkins +++ b/jenkins @@ -25,9 +25,9 @@ pipeline{ environment { def scannerHome = tool 'SonarQube Scanner 2.4' } - steps { + steps{ withSonarQubeEnv('sonarqube-scanner'){ - sh 'mvn clean package sonar:sonar' + sh "${scannerHome}/bin/sonar-scanner" } } sleep time: 30000, unit: 'MILLISECONDS' From 2f5d17e37e8d4b83c0fc4c2096a17975d282fe77 Mon Sep 17 00:00:00 2001 From: kallepalli Date: Sat, 26 Mar 2022 14:12:46 +0530 Subject: [PATCH 14/14] updated --- jenkins | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jenkins b/jenkins index d28591436..c16b82aca 100644 --- a/jenkins +++ b/jenkins @@ -7,21 +7,21 @@ pipeline{ } } - stage("build code"){ + stage("build code"){ steps{ sh "mvn clean install" } } - stage("test code"){ + stage("test code"){ steps{ sh "mvn test" } } - stage('Sonarqube Analysis'){ + stage("Sonarqube Analysis"){ environment { def scannerHome = tool 'SonarQube Scanner 2.4' } @@ -30,13 +30,13 @@ pipeline{ sh "${scannerHome}/bin/sonar-scanner" } } - sleep time: 30000, unit: 'MILLISECONDS' + sleep time: 30000, unit: 'MILLISECONDS' script { def qg = waitForQualityGate() if (qg.status != 'OK') { error "Pipeline aborted due to quality gate failure: ${qg.status}" - } } + } } } }