From 084de5ae2162e41dce40e14749aa8ce326cf40af Mon Sep 17 00:00:00 2001 From: DevopsTech12 Date: Thu, 10 Jul 2025 15:44:18 +0530 Subject: [PATCH 01/31] Update pom.xml --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 70aeac29d..9fa19b2b3 100644 --- a/pom.xml +++ b/pom.xml @@ -272,6 +272,11 @@ maven-war-plugin 3.4.0 + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + org.jacoco From bf9e770073f9178060632db03bd570ba50f718a1 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Thu, 31 Jul 2025 12:07:50 +0530 Subject: [PATCH 02/31] jenkinsfile1 added --- jenkinsfile1 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 jenkinsfile1 diff --git a/jenkinsfile1 b/jenkinsfile1 new file mode 100644 index 000000000..00a4c4160 --- /dev/null +++ b/jenkinsfile1 @@ -0,0 +1,33 @@ +pipeline +{ + agent any + tools{ + maven "MAVEN_HOME" + jdk "JAVA_HOME" + } + environment{ + GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" + } + stages{ + stage("scm chekout") + { + steps{git branch:'local', url:"$GIT_URL"} + } + stage("test") + { + steps{sh 'mvn test'} + } + stage("build artifact") + { + steps{sh 'mvn build -Dskiptest'} + post{ + success{ + echo "archiving artifact" + sleep 10 + archiveArtifacts artifacts: '**/*.war' + } + } + } + + } +} \ No newline at end of file From 4b8f4bca74d6148bf37b4a4b8608a3b0ea9b5dfd Mon Sep 17 00:00:00 2001 From: vaibhav Date: Thu, 31 Jul 2025 12:50:56 +0530 Subject: [PATCH 03/31] fixed jenkins issue --- jenkinsfile1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 00a4c4160..1ff97a734 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -3,7 +3,7 @@ pipeline agent any tools{ maven "MAVEN_HOME" - jdk "JAVA_HOME" + jdk "JAVA-17" } environment{ GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" @@ -11,7 +11,7 @@ pipeline stages{ stage("scm chekout") { - steps{git branch:'local', url:"$GIT_URL"} + steps{ git branch: 'local', url: "$GIT_URL" } } stage("test") { @@ -19,7 +19,7 @@ pipeline } stage("build artifact") { - steps{sh 'mvn build -Dskiptest'} + steps{sh 'mvn package -Dskiptest'} post{ success{ echo "archiving artifact" From 8d03eea0596e0bac2156294fe5ceabd05a4447a5 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sat, 2 Aug 2025 12:07:20 +0530 Subject: [PATCH 04/31] sonar stage --- jenkinsfile1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jenkinsfile1 b/jenkinsfile1 index 1ff97a734..85944cb1f 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -28,6 +28,17 @@ pipeline } } } + stage("checkstyle checks") + { + steps{sh 'mvn chckstyle:checkstyle'} + } + + stage("sonar qube analysis") + { + steps{ withSonarQubeEnv(credentialsId: 'SonarToken') { + sh 'mvn sonar:sonar' +}} + } } } \ No newline at end of file From 836b3f92016104685931f32bfc7c851e0cbeeb14 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sat, 2 Aug 2025 12:22:07 +0530 Subject: [PATCH 05/31] sonar --- jenkinsfile1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 85944cb1f..68e32039a 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -35,7 +35,7 @@ pipeline stage("sonar qube analysis") { - steps{ withSonarQubeEnv(credentialsId: 'SonarToken') { + steps{ withSonarQubeEnv(credentialsId: 'SonarToken', installationName: 'SonarServer') { sh 'mvn sonar:sonar' }} } From b122f5aa34ce725eca9f4832aa3e5bf1cdf5af8f Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sat, 2 Aug 2025 12:25:27 +0530 Subject: [PATCH 06/31] checkstyle --- jenkinsfile1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 68e32039a..7f45049e3 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -30,7 +30,7 @@ pipeline } stage("checkstyle checks") { - steps{sh 'mvn chckstyle:checkstyle'} + steps{sh 'mvn checkstyle:checkstyle'} } stage("sonar qube analysis") From 60f5d5b71134b970e4fe83bf1df814733feadf50 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sun, 3 Aug 2025 18:11:56 +0530 Subject: [PATCH 07/31] slack notification --- jenkinsfile1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 7f45049e3..2d15458a4 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -38,7 +38,18 @@ pipeline steps{ withSonarQubeEnv(credentialsId: 'SonarToken', installationName: 'SonarServer') { sh 'mvn sonar:sonar' }} - } + } +} + post{ + always{ + slackSend channel: '#devops', + color: '#439FE0', + message: '*${CurrentBuild.current Result}:*job.${env.JOB_NAME}.build.${env.BUILD_NUMBER}', + teamDomain: 'vbtech-workspace', + tokenCredentialId: 'Slack-Jenkins' + + } + } } \ No newline at end of file From b421f403ffb23ca5f7712187e18c32da791ea812 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sun, 3 Aug 2025 18:20:16 +0530 Subject: [PATCH 08/31] slack notification error --- jenkinsfile1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 2d15458a4..f566d833c 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -46,7 +46,7 @@ pipeline always{ slackSend channel: '#devops', color: '#439FE0', - message: '*${CurrentBuild.current Result}:*job.${env.JOB_NAME}.build.${env.BUILD_NUMBER}', + message: "*${CurrentBuild.current Result}:*job.${env.JOB_NAME}.build.${env.BUILD_NUMBER}", teamDomain: 'vbtech-workspace', tokenCredentialId: 'Slack-Jenkins' From 0b035b1ebff3b0e3155d8f3a98cce97ccd3e78d7 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sun, 3 Aug 2025 18:36:51 +0530 Subject: [PATCH 09/31] slack --- jenkinsfile1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index f566d833c..562468089 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -42,14 +42,14 @@ pipeline } } - post{ - always{ - slackSend channel: '#devops', + post { + success { + slackSend ( channel: '#devops', color: '#439FE0', - message: "*${CurrentBuild.current Result}:*job.${env.JOB_NAME}.build.${env.BUILD_NUMBER}", + message: "✅ *Build SUCCESS* for Job: `${env.JOB_NAME}` Build: #${env.BUILD_NUMBER}\n<${env.BUILD_URL}|Open Build>", teamDomain: 'vbtech-workspace', tokenCredentialId: 'Slack-Jenkins' - + ) } } } \ No newline at end of file From d15d82aedf1d7b5cb7d428ed8dd55cbfb906c7f8 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sun, 3 Aug 2025 18:44:52 +0530 Subject: [PATCH 10/31] slack replace --- jenkinsfile1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 562468089..a93f6fca0 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -44,12 +44,12 @@ pipeline } post { success { - slackSend ( channel: '#devops', - color: '#439FE0', - message: "✅ *Build SUCCESS* for Job: `${env.JOB_NAME}` Build: #${env.BUILD_NUMBER}\n<${env.BUILD_URL}|Open Build>", - teamDomain: 'vbtech-workspace', + slackSend channel: '#devops', + color: '#439FE0', + message: "✅ *Build SUCCESS* for Job: `${env.JOB_NAME}` Build: #${env.BUILD_NUMBER}\n<${env.BUILD_URL}|Open Build>", + teamDomain: 'vbtech-workspace', tokenCredentialId: 'Slack-Jenkins' - ) + } } } \ No newline at end of file From f2be83d65d9bd25d42b96c7d386cbdce2856a5f6 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Sun, 3 Aug 2025 18:50:22 +0530 Subject: [PATCH 11/31] error in git url --- jenkinsfile1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index a93f6fca0..1ccef93ee 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -6,7 +6,7 @@ pipeline jdk "JAVA-17" } environment{ - GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" + GIT_URL="https://github.com/DevopsTech12/vprofile-project.git1" } stages{ stage("scm chekout") @@ -50,6 +50,14 @@ pipeline teamDomain: 'vbtech-workspace', tokenCredentialId: 'Slack-Jenkins' + } + failure { + slackSend channel: '#devops', + color: '#FF0000', + message: "❌ *Build FAILED* for Job: `${env.JOB_NAME}` Build: #${env.BUILD_NUMBER}\n<${env.BUILD_URL}|Check Console>", + teamDomain: 'vbtech-workspace', + tokenCredentialId: 'Slack-Jenkins' + } } } \ No newline at end of file From 82b6610c33b8dd95a6ac2845331ee7b1d5940174 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 00:57:48 +0530 Subject: [PATCH 12/31] dockefile and ecr --- Dockerfile | 14 ++++++++++++++ jenkinsfile1 | 25 ++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..b4cbf6a5d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Use official Tomcat base image +FROM tomcat:9.0 + +# Remove default webapps (optional) +RUN rm -rf /usr/local/tomcat/webapps/* + +# Copy your WAR file into the webapps directory +COPY vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war + +# Expose the default Tomcat port +EXPOSE 8080 + +# Start Tomcat +CMD ["catalina.sh", "run"] \ No newline at end of file diff --git a/jenkinsfile1 b/jenkinsfile1 index 1ccef93ee..1fa9ce434 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -33,14 +33,29 @@ pipeline steps{sh 'mvn checkstyle:checkstyle'} } - stage("sonar qube analysis") + // stage("sonar qube analysis") + // { + // steps{ withSonarQubeEnv(credentialsId: 'SonarToken', installationName: 'SonarServer') { + // sh 'mvn sonar:sonar' +//}} + stage("docker image build") { - steps{ withSonarQubeEnv(credentialsId: 'SonarToken', installationName: 'SonarServer') { - sh 'mvn sonar:sonar' -}} - + steps{ + docker build -t vprofileapp . + } + } + stage ('push image to ECR') + { + steps{ + // This step should not normally be used in your script. Consult the inline help for details. + withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp') { + docker push ("$BUILD_NUMBER") +} + } + } } + } post { success { From 4adfe2fee8724bf660ddcbc3e57ed551cf129eee Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:07:28 +0530 Subject: [PATCH 13/31] jenkinsfile --- jenkinsfile1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 1fa9ce434..b490e3e96 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -49,14 +49,12 @@ pipeline steps{ // This step should not normally be used in your script. Consult the inline help for details. withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp') { - docker push ("$BUILD_NUMBER") -} + docker push ("$BUILD_NUMBER") } } } - } + } -} post { success { slackSend channel: '#devops', From ea6e64c15751863f65ba8e6009b0204ca29f93a6 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:15:16 +0530 Subject: [PATCH 14/31] jenins1 --- jenkinsfile1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index b490e3e96..5bb5227b5 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -6,7 +6,8 @@ pipeline jdk "JAVA-17" } environment{ - GIT_URL="https://github.com/DevopsTech12/vprofile-project.git1" + GIT_URL="https://github.com/DevopsTech12/vprofile-project.git1" + ECR_REPO = '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp' } stages{ stage("scm chekout") @@ -41,7 +42,8 @@ pipeline stage("docker image build") { steps{ - docker build -t vprofileapp . + script { + dockerImage = docker.build("${IMAGE_NAME}:${BUILD_NUMBER}") } } stage ('push image to ECR') @@ -49,7 +51,7 @@ pipeline steps{ // This step should not normally be used in your script. Consult the inline help for details. withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp') { - docker push ("$BUILD_NUMBER") } + sh "docker push ${ECR_REPO}:latest"("$BUILD_NUMBER") } } } From 9777cd519196a778f04b441e36c743b3ab7481d2 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:17:28 +0530 Subject: [PATCH 15/31] jenkinsfileadded --- jenkinsfile1 | 1 + 1 file changed, 1 insertion(+) diff --git a/jenkinsfile1 b/jenkinsfile1 index 5bb5227b5..e66ae1562 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -56,6 +56,7 @@ pipeline } } + } post { success { From d4958565e3d005687774b3dacd7cf1c99ea9973d Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:22:30 +0530 Subject: [PATCH 16/31] jenkin --- jenkinsfile1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index e66ae1562..8979950d5 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -39,13 +39,14 @@ pipeline // steps{ withSonarQubeEnv(credentialsId: 'SonarToken', installationName: 'SonarServer') { // sh 'mvn sonar:sonar' //}} - stage("docker image build") + stage('docker image build') { - steps{ + steps { script { dockerImage = docker.build("${IMAGE_NAME}:${BUILD_NUMBER}") } } + } stage ('push image to ECR') { steps{ @@ -56,7 +57,6 @@ pipeline } } - } post { success { @@ -76,4 +76,5 @@ pipeline } } -} \ No newline at end of file +} + \ No newline at end of file From 72084800dfb85377eb22249f9597add865d906d0 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:24:31 +0530 Subject: [PATCH 17/31] jenkinsfile --- jenkinsfile1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 8979950d5..912a4c561 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -6,7 +6,7 @@ pipeline jdk "JAVA-17" } environment{ - GIT_URL="https://github.com/DevopsTech12/vprofile-project.git1" + GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" ECR_REPO = '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp' } stages{ From c3ba18c8bc3e24e91655045253bc76c5bf926e95 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:29:58 +0530 Subject: [PATCH 18/31] jekin --- jenkinsfile1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 912a4c561..5b40f979e 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -7,7 +7,8 @@ pipeline } environment{ GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" - ECR_REPO = '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp' + ECR_REPO = '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp' + IMAGE_NAME = 'vprofileapp' } stages{ stage("scm chekout") From 64ea31f90824f11d5bc20f284a62ff51e1d8d33b Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:36:14 +0530 Subject: [PATCH 19/31] docker file --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b4cbf6a5d..1ba5c19c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM tomcat:9.0 RUN rm -rf /usr/local/tomcat/webapps/* # Copy your WAR file into the webapps directory -COPY vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war +COPY **/*.war /usr/local/tomcat/webapps/ROOT.war # Expose the default Tomcat port EXPOSE 8080 From 2b2fd746fee8c3eff89bef81789975188df1b4f2 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 01:42:36 +0530 Subject: [PATCH 20/31] jenkinsfile --- jenkinsfile1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 5b40f979e..434aeeaad 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -7,7 +7,7 @@ pipeline } environment{ GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" - ECR_REPO = '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp' + ECR_REPO = 'https://279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp' IMAGE_NAME = 'vprofileapp' } stages{ From 4d365b6451c149ef7e02aff04e097389c5aeeb2d Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 11:31:48 +0530 Subject: [PATCH 21/31] jenkinsfileECR --- jenkinsfile1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 434aeeaad..79bfebc0d 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -7,7 +7,7 @@ pipeline } environment{ GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" - ECR_REPO = 'https://279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp' + ECR_REPO = "https://279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp" IMAGE_NAME = 'vprofileapp' } stages{ @@ -52,7 +52,7 @@ pipeline { steps{ // This step should not normally be used in your script. Consult the inline help for details. - withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: '279684396313.dkr.ecr.ap-south-1.amazonaws.com/vprofileapp') { + withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") { sh "docker push ${ECR_REPO}:latest"("$BUILD_NUMBER") } } } From 71480b10aa8a969bc30252dd8a771783a9d792f8 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 11:50:02 +0530 Subject: [PATCH 22/31] file --- jenkinsfile1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 79bfebc0d..514f55057 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -44,7 +44,8 @@ pipeline { steps { script { - dockerImage = docker.build("${IMAGE_NAME}:${BUILD_NUMBER}") + dockerImage = docker.build("${IMAGE_NAME}:latest") + dockerImage.tag("${ECR_REPO}", "latest") } } } @@ -53,7 +54,7 @@ pipeline steps{ // This step should not normally be used in your script. Consult the inline help for details. withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") { - sh "docker push ${ECR_REPO}:latest"("$BUILD_NUMBER") } + sh "docker push ${ECR_REPO}:latest" } } } From eef7e0d71b6c1907ab2c59b91b975130e1f260fe Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 11:53:18 +0530 Subject: [PATCH 23/31] fileadded --- jenkinsfile1 | 1 - 1 file changed, 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 514f55057..2cc3296f9 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -45,7 +45,6 @@ pipeline steps { script { dockerImage = docker.build("${IMAGE_NAME}:latest") - dockerImage.tag("${ECR_REPO}", "latest") } } } From df360174a780efe70377b4fd88689f7d447fbdac Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 12:01:17 +0530 Subject: [PATCH 24/31] file1 --- jenkinsfile1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 2cc3296f9..00a50d6c2 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -52,8 +52,11 @@ pipeline { steps{ // This step should not normally be used in your script. Consult the inline help for details. - withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") { - sh "docker push ${ECR_REPO}:latest" } + withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") {script { + dockerImage.tag("${ECR_REPO}", "latest") + sh "docker push ${ECR_REPO}:latest" + } + // sh "docker push ${ECR_REPO}:latest" } } } From f835b252c9f01870bfe976a34bd7c847f886f83d Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 12:04:04 +0530 Subject: [PATCH 25/31] file2 --- jenkinsfile1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 00a50d6c2..8f8af399f 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -56,8 +56,9 @@ pipeline dockerImage.tag("${ECR_REPO}", "latest") sh "docker push ${ECR_REPO}:latest" } - // sh "docker push ${ECR_REPO}:latest" } + // sh "docker push ${ECR_REPO}:latest" } + } } } From fcef12b59a17d16710e3c936bac7e969f15b1842 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 12:09:01 +0530 Subject: [PATCH 26/31] file1 --- jenkinsfile1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 8f8af399f..85583e693 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -52,7 +52,7 @@ pipeline { steps{ // This step should not normally be used in your script. Consult the inline help for details. - withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") {script { + withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") { dockerImage.tag("${ECR_REPO}", "latest") sh "docker push ${ECR_REPO}:latest" } @@ -61,8 +61,6 @@ pipeline } } - } - post { success { slackSend channel: '#devops', From aa9329947f4498ece9451bce95996c34d5de8804 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 12:12:10 +0530 Subject: [PATCH 27/31] file3 --- jenkinsfile1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 85583e693..0ba98032b 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -45,6 +45,7 @@ pipeline steps { script { dockerImage = docker.build("${IMAGE_NAME}:latest") + dockerImage.tag("${ECR_REPO}", "latest") } } } @@ -53,7 +54,6 @@ pipeline steps{ // This step should not normally be used in your script. Consult the inline help for details. withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") { - dockerImage.tag("${ECR_REPO}", "latest") sh "docker push ${ECR_REPO}:latest" } // sh "docker push ${ECR_REPO}:latest" From e435500a3c80cae24956964cd58d59d3a2e7304f Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 12:17:40 +0530 Subject: [PATCH 28/31] file4 --- jenkinsfile1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 0ba98032b..712f4bd73 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -45,10 +45,16 @@ pipeline steps { script { dockerImage = docker.build("${IMAGE_NAME}:latest") - dockerImage.tag("${ECR_REPO}", "latest") } } } + stage('TAG docker image') { + steps { + script { + dockerImage.tag("${ECR_REPO}", "latest") + } + } + } stage ('push image to ECR') { steps{ From 0d1f6ce78988dd0eb03b332d9d6f9133fabed846 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 12:41:16 +0530 Subject: [PATCH 29/31] file5 --- jenkinsfile1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 712f4bd73..8a2494b3f 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -48,13 +48,6 @@ pipeline } } } - stage('TAG docker image') { - steps { - script { - dockerImage.tag("${ECR_REPO}", "latest") - } - } - } stage ('push image to ECR') { steps{ From 4324dbb0b4d2eef5721cb90fd62b9fd5163da594 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Mon, 4 Aug 2025 12:47:40 +0530 Subject: [PATCH 30/31] file6 --- jenkinsfile1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkinsfile1 b/jenkinsfile1 index 8a2494b3f..e4837571d 100644 --- a/jenkinsfile1 +++ b/jenkinsfile1 @@ -53,7 +53,8 @@ pipeline steps{ // This step should not normally be used in your script. Consult the inline help for details. withDockerRegistry(credentialsId: 'ecr:ap-south-1:ecrcred', url: "${ECR_REPO}") { - sh "docker push ${ECR_REPO}:latest" + sh "docker push ${IMAGE_NAME}:latest" + //sh "docker push ${ECR_REPO}:latest" } // sh "docker push ${ECR_REPO}:latest" } From b0d638e5c5d6631cb3ef12e6543893409c90b037 Mon Sep 17 00:00:00 2001 From: vaibhav Date: Fri, 15 Aug 2025 11:29:30 +0530 Subject: [PATCH 31/31] jenkinsfile2 --- jenkinsfile2 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 jenkinsfile2 diff --git a/jenkinsfile2 b/jenkinsfile2 new file mode 100644 index 000000000..43399ef9a --- /dev/null +++ b/jenkinsfile2 @@ -0,0 +1,28 @@ +pipeline{ + agent any + tools { + maven 'MAVEN_HOME' + java 'JAVA_HOME' + } + environment{ + GIT_URL="https://github.com/DevopsTech12/vprofile-project.git" + + } + stages{ + stage('scm checkout') + steps{git branch: 'local', url: "$GIT_URL" + } + stage('Testing') + steps{sh 'mvn test' + + } + stage('build artifact') + steps{sh 'mvn clean package -Dskiptest'} + post{ + success{slackSend channel: '#artifact', message: '"✅ *Artifact build* for Job: `${env.JOB_NAME}` Build: #${env.BUILD_NUMBER}\\n<${env.BUILD_URL}|Open Build>"', teamDomain: 'vbtech-workspace', tokenCredentialId: 'artifact-slack-jenkins' + + } + } + + } +} \ No newline at end of file