From e3d675af60ddab19133bf5520b8b7b9d4cb38b06 Mon Sep 17 00:00:00 2001 From: n Date: Sun, 5 Mar 2023 22:45:58 +0530 Subject: [PATCH 01/25] jenkins build pipeline --- jenkins-pipeline | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 jenkins-pipeline diff --git a/jenkins-pipeline b/jenkins-pipeline new file mode 100644 index 000000000..522979856 --- /dev/null +++ b/jenkins-pipeline @@ -0,0 +1,22 @@ +pipeliene { + agent { label 'MAVEN_JDK17' } + stages { + stage( 'version control sysytem') { + steps { + git url: 'https://github.com/spring-projects/spring-petclinic.git', + branch: 'main' + } + } + stage( 'package' ) { + steps { + sh: 'export PATH="/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH" && ./gradlew build', + } + } + stage( 'post build' ) { + steps { + archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0/jar' + onlyIfSuccesful: true + junit testresults: '**/test-results/test/TEST-*.xml' + } + } +} \ No newline at end of file From bf55d1ab473094434c24152054132723f61b80c0 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 13:19:36 +0530 Subject: [PATCH 02/25] Added the new changes --- jenkins-pipeline => Jenkinsfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jenkins-pipeline => Jenkinsfile (100%) diff --git a/jenkins-pipeline b/Jenkinsfile similarity index 100% rename from jenkins-pipeline rename to Jenkinsfile From ff9cac07ec85eb9ca246344ee93f983d4ca65e71 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 13:25:11 +0530 Subject: [PATCH 03/25] Added the new trigger in jenkins file --- jenkins-pipeline | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 jenkins-pipeline diff --git a/jenkins-pipeline b/jenkins-pipeline new file mode 100644 index 000000000..5d743c097 --- /dev/null +++ b/jenkins-pipeline @@ -0,0 +1,23 @@ +pipeliene { + agent { label 'any' } + triggers { pollSCM '* * * * *' } + stages { + stage( 'version control sysytem') { + steps { + git url: 'https://github.com/spring-projects/spring-petclinic.git', + branch: 'main' + } + } + stage( 'package' ) { + steps { + sh: 'export PATH="/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH" && ./gradlew build', + } + } + stage( 'post build' ) { + steps { + archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0/jar' + onlyIfSuccesful: true + junit testresults: '**/test-results/test/TEST-*.xml' + } + } +} \ No newline at end of file From 9007773450591a676544689c3030758057f57cdb Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 13:35:15 +0530 Subject: [PATCH 04/25] Added the issue fixing --- jenkins-pipeline | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkins-pipeline b/jenkins-pipeline index 5d743c097..c0bcfb5e9 100644 --- a/jenkins-pipeline +++ b/jenkins-pipeline @@ -20,4 +20,5 @@ pipeliene { junit testresults: '**/test-results/test/TEST-*.xml' } } -} \ No newline at end of file + } +} \ No newline at end of file From 93c2c6e14053de849fd72b95d45b1383374b6a66 Mon Sep 17 00:00:00 2001 From: batchusivaji <123230969+batchusivaji@users.noreply.github.com> Date: Tue, 7 Mar 2023 13:38:30 +0530 Subject: [PATCH 05/25] Update Jenkinsfile --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 522979856..540ba4164 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,6 @@ pipeliene { - agent { label 'MAVEN_JDK17' } + agent { label 'JDK_17' } + triggers { pollSCM '* * * * *' } stages { stage( 'version control sysytem') { steps { @@ -19,4 +20,4 @@ pipeliene { junit testresults: '**/test-results/test/TEST-*.xml' } } -} \ No newline at end of file +} From a8543e98092748cff7eb65f181f04e9d47344787 Mon Sep 17 00:00:00 2001 From: batchusivaji <123230969+batchusivaji@users.noreply.github.com> Date: Tue, 7 Mar 2023 13:40:32 +0530 Subject: [PATCH 06/25] Update Jenkinsfile --- Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 540ba4164..7db59dbf0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,11 +8,6 @@ pipeliene { branch: 'main' } } - stage( 'package' ) { - steps { - sh: 'export PATH="/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH" && ./gradlew build', - } - } stage( 'post build' ) { steps { archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0/jar' From b10540bd1961f4fd7a398a7f1acf1069f8dcefb2 Mon Sep 17 00:00:00 2001 From: batchusivaji <123230969+batchusivaji@users.noreply.github.com> Date: Tue, 7 Mar 2023 13:44:28 +0530 Subject: [PATCH 07/25] Update Jenkinsfile --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7db59dbf0..8c1d69535 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,8 @@ pipeliene { steps { archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0/jar' onlyIfSuccesful: true - junit testresults: '**/test-results/test/TEST-*.xml' + junit testResults: '**/test-results/test/TEST-*.xml' } } -} + } +} From db786a8049cdf490c769eee7155b751f1c33c997 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:10:11 +0530 Subject: [PATCH 08/25] Added the new changes --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8c1d69535..ddd0fce7c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeliene { - agent { label 'JDK_17' } + agent { label 'any' } triggers { pollSCM '* * * * *' } stages { stage( 'version control sysytem') { @@ -10,7 +10,7 @@ pipeliene { } stage( 'post build' ) { steps { - archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0/jar' + archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0.jar' onlyIfSuccesful: true junit testResults: '**/test-results/test/TEST-*.xml' } From 23f1ebfe4dafa293fe10f4f1f1d62140a9df6dd0 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:13:19 +0530 Subject: [PATCH 09/25] Added the new chnges in jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ddd0fce7c..8cbcae1a9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeliene { - agent { label 'any' } + agent any triggers { pollSCM '* * * * *' } stages { stage( 'version control sysytem') { From 8ea5c95dd2fbc179fd6d42c07d7ab55fb40c36c6 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:18:25 +0530 Subject: [PATCH 10/25] Added the package shell in jenkinsfile --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8cbcae1a9..53afb709f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,9 +8,14 @@ pipeliene { branch: 'main' } } + stage ('package') { + steps { + sh 'mvn package' + } + } stage( 'post build' ) { steps { - archiveArtifacts artifacts: '**/libs/spring-petclinic-3.0.0.jar' + archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar' onlyIfSuccesful: true junit testResults: '**/test-results/test/TEST-*.xml' } From 315a72b91eb129e674b6fa66b0a827a12a37f7fc Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:20:23 +0530 Subject: [PATCH 11/25] Added the new chnges in jenkinsfile --- Jenkinsfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53afb709f..7c37cbde1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,12 +13,5 @@ pipeliene { sh 'mvn package' } } - stage( 'post build' ) { - steps { - archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar' - onlyIfSuccesful: true - junit testResults: '**/test-results/test/TEST-*.xml' - } - } } } From e9f397506473af5aaf237266b457f406213db549 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:24:26 +0530 Subject: [PATCH 12/25] Added the name change in pipeline --- Jenkinsfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7c37cbde1..a1952d10a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ -pipeliene { - agent any +pipeline { + agent 'any' triggers { pollSCM '* * * * *' } stages { stage( 'version control sysytem') { @@ -13,5 +13,12 @@ pipeliene { sh 'mvn package' } } + stage( 'post build' ) { + steps { + archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar' + onlyIfSuccesful: true + junit testResults: '**/test-results/test/TEST-*.xml' + } + } } } From 30995b0d168198fd31a2a047aebb08fd3c4940de Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:26:15 +0530 Subject: [PATCH 13/25] Added the name change in pipeline --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a1952d10a..740394ccb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,9 +16,9 @@ pipeline { stage( 'post build' ) { steps { archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar' - onlyIfSuccesful: true + onlyIfSuccesful: 'true' junit testResults: '**/test-results/test/TEST-*.xml' } } } -} +} \ No newline at end of file From 85c461846c68fcf6b3f9d0717a7f11deb4cf6b07 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:27:45 +0530 Subject: [PATCH 14/25] Added the name change in pipeline --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 740394ccb..92c759474 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,8 +15,8 @@ pipeline { } stage( 'post build' ) { steps { - archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar' - onlyIfSuccesful: 'true' + archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar', + onlyIfSuccesful: 'true', junit testResults: '**/test-results/test/TEST-*.xml' } } From 569b3cfd680ca49e6f1dc1092eee55326a79753d Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:29:58 +0530 Subject: [PATCH 15/25] Added the name change in pipeline --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 92c759474..c2cf9bfd6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { stage( 'post build' ) { steps { archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar', - onlyIfSuccesful: 'true', + onlyIfSuccesful: 'true' junit testResults: '**/test-results/test/TEST-*.xml' } } From c03613da5a3f4646bc8fb6cc49b76b6046441b5d Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:31:46 +0530 Subject: [PATCH 16/25] Added the name change in pipeline --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c2cf9bfd6..951c3e6ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,6 @@ pipeline { stage( 'post build' ) { steps { archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar', - onlyIfSuccesful: 'true' junit testResults: '**/test-results/test/TEST-*.xml' } } From 27734ce912d94a3be6d4875db8b64fe09fc49d34 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:39:02 +0530 Subject: [PATCH 17/25] Added the name change in pipeline --- Jenkinsfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 951c3e6ae..a361d6f2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,10 +13,16 @@ pipeline { sh 'mvn package' } } - stage( 'post build' ) { + stage('build') { steps { - archiveArtifacts artifacts: '**/spring-petclinic-3.0.0.jar', - junit testResults: '**/test-results/test/TEST-*.xml' + sh 'export PATH="/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin:$PATH" && mvn package' + } + } + stage('postbuild') + { + archiveArtifacts artifacts: '**/target/spring-petclinic.war', + followSymlinks: false + junit '**/surefire-reports/TEST-*.xml' } } } From 3dd6fd2bf2a8888f020d9c9e7aa60f82ac2edecc Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Mar 2023 15:42:00 +0530 Subject: [PATCH 18/25] Added the name change in pipeline --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a361d6f2c..ea9a3751a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,11 +18,11 @@ pipeline { sh 'export PATH="/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin:$PATH" && mvn package' } } - stage('postbuild') - { - archiveArtifacts artifacts: '**/target/spring-petclinic.war', - followSymlinks: false - junit '**/surefire-reports/TEST-*.xml' + stage('postbuild') { + steps { + archiveArtifacts artifacts: '**/target/spring-petclinic.war', + followSymlinks: false + junit '**/surefire-reports/TEST-*.xml' } } } From bc5161a6c2f4507de10e35e5089d6fb433cc5d6c Mon Sep 17 00:00:00 2001 From: n Date: Fri, 10 Mar 2023 15:24:46 +0530 Subject: [PATCH 19/25] Added the new file sonar --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ea9a3751a..77ec5654c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,9 +18,15 @@ pipeline { sh 'export PATH="/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin:$PATH" && mvn package' } } + stage('sonar analysis') { + steps { + withSonarQubeEnv('SONAR_TOKEN') { + sh 'mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=qtsonarqube_qtsonarqube-token -Dsonar.organization=qtsonarqube' + } + } stage('postbuild') { steps { - archiveArtifacts artifacts: '**/target/spring-petclinic.war', + archiveArtifacts artifacts: '**/target/spring-petclinic-3.0.0-SNAPSHOT.jar', followSymlinks: false junit '**/surefire-reports/TEST-*.xml' } From 0a5a095da1953a2e2b83bf36a842ee8719bf33c0 Mon Sep 17 00:00:00 2001 From: n Date: Fri, 10 Mar 2023 15:33:58 +0530 Subject: [PATCH 20/25] added the new change in jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 77ec5654c..6298b77d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,8 +22,9 @@ pipeline { steps { withSonarQubeEnv('SONAR_TOKEN') { sh 'mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=qtsonarqube_qtsonarqube-token -Dsonar.organization=qtsonarqube' + } } - } + } stage('postbuild') { steps { archiveArtifacts artifacts: '**/target/spring-petclinic-3.0.0-SNAPSHOT.jar', From f39a9fc41be8f7e9b7d02c1cac5e37bfdcd8feb1 Mon Sep 17 00:00:00 2001 From: n Date: Fri, 10 Mar 2023 16:12:04 +0530 Subject: [PATCH 21/25] Added the new file for jfrog --- Jenkinsfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6298b77d1..9bb840998 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,6 +18,47 @@ pipeline { sh 'export PATH="/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin:$PATH" && mvn package' } } + stage ('Artifactory configuration') { + steps { + rtServer ( + id: "ARTIFACTORY_SERVER", + url: 'https://qtsivajijfrog.jfrog.io/artifactory', + credentialsId: 'JFROG_TOKEN' + ) + + rtMavenDeployer ( + id: "MAVEN_DEPLOYER", + serverId: "ARTIFACTORY_SERVER", + releaseRepo: 'libs-release', + snapshotRepo: 'libs-snapshot' + ) + + rtMavenResolver ( + id: "MAVEN_RESOLVER", + serverId: "ARTIFACTORY_SERVER", + releaseRepo: 'libs-release', + snapshotRepo: 'libs-snapshot' + ) + } + } + stage('package') { + tools { + jdk 'JDK_17' + } + steps { + rtMavenRun ( + tool: 'MAVEN_DEFAULT', + pom: 'pom.xml', + goals: 'clean install', + deployerId: "MAVEN_DEPLOYER" + + ) + rtPublishBuildInfo ( + serverId: "ARTIFACTORY_SERVER" + ) + //sh "mvn ${params.MAVEN_GOAL}" + } + } stage('sonar analysis') { steps { withSonarQubeEnv('SONAR_TOKEN') { From 3d00af8c5a21a13a16f7d18af0fc1b43fb535b77 Mon Sep 17 00:00:00 2001 From: n Date: Fri, 10 Mar 2023 16:17:54 +0530 Subject: [PATCH 22/25] Added the new connectin --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9bb840998..2ce9a18a7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,11 +4,11 @@ pipeline { stages { stage( 'version control sysytem') { steps { - git url: 'https://github.com/spring-projects/spring-petclinic.git', - branch: 'main' + git url: 'https://github.com/spring-projects/spring-petclinic.git', + branch: 'main' } } - stage ('package') { + stage('package') { steps { sh 'mvn package' } @@ -18,7 +18,7 @@ pipeline { sh 'export PATH="/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin:$PATH" && mvn package' } } - stage ('Artifactory configuration') { + stage('Artifactory configuration') { steps { rtServer ( id: "ARTIFACTORY_SERVER", From 909e5d2d3d07180f03c7627e81723e3c25149036 Mon Sep 17 00:00:00 2001 From: n Date: Fri, 10 Mar 2023 16:21:04 +0530 Subject: [PATCH 23/25] Added the new jenkinsfile --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 2ce9a18a7..61e6ec804 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,9 @@ pipeline { agent 'any' triggers { pollSCM '* * * * *' } + parameters { + choice(name: 'MAVEN_GOAL', choices: ['package', 'install', 'clean'], description: 'MAVEN_GOAL') + } stages { stage( 'version control sysytem') { steps { From b46a6bd6503bf528e239939fb18c932a1b8bd78d Mon Sep 17 00:00:00 2001 From: n Date: Fri, 10 Mar 2023 16:23:19 +0530 Subject: [PATCH 24/25] added thew new file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 61e6ec804..4ec15f7c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ pipeline { ) } } - stage('package') { + stage('packaged') { tools { jdk 'JDK_17' } From 0daa3f5c4b92c3fca5bc69a8b9735ac753218fca Mon Sep 17 00:00:00 2001 From: batchusivaji <123230969+batchusivaji@users.noreply.github.com> Date: Sat, 25 Mar 2023 13:34:53 +0530 Subject: [PATCH 25/25] Create hi --- hi | 1 + 1 file changed, 1 insertion(+) create mode 100644 hi diff --git a/hi b/hi new file mode 100644 index 000000000..45b983be3 --- /dev/null +++ b/hi @@ -0,0 +1 @@ +hi