From 091e1077c45f8a969d5957a2bbfa440e5e370891 Mon Sep 17 00:00:00 2001 From: Ravichandu-git Date: Fri, 14 Mar 2025 13:10:51 +0530 Subject: [PATCH 1/4] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b586f6f..84a44b1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 works.buddy.samples - works-with-heroku + ravi-works-with-jenkins 1.0 war From fc8754d6cde74e80cbf58ab33822e8e093dbe914 Mon Sep 17 00:00:00 2001 From: Ravichandu-git Date: Wed, 19 Mar 2025 15:59:45 +0530 Subject: [PATCH 2/4] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c978297..720e848 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent any + agent tomcat stages { stage('Checkout') { steps { From c8a5d6f1e5238092f256c71cc2de75ed14cb9711 Mon Sep 17 00:00:00 2001 From: Ravichandu-git Date: Wed, 19 Mar 2025 16:03:07 +0530 Subject: [PATCH 3/4] Update Jenkinsfile --- Jenkinsfile | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 720e848..0bb7cf2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,15 @@ pipeline { agent tomcat stages { - stage('Checkout') { + stage('git Checkout') { steps { - echo 'Checkout completed' - } - } - stage('Static-test') { - steps { - echo 'Running static tests on code' + git branch: 'main', url: 'https://github.com/Ravichandu-git/java-example.git' } } + stage('Build') { steps { - sh 'echo "Building the code"' - } - } - stage('Deploy') { - steps { - echo 'Deploying into environment' + sh 'mvn clean install' } } } From 88f058c8ed787e59629087c39ef88bc657c354cb Mon Sep 17 00:00:00 2001 From: Ravichandu-git Date: Wed, 19 Mar 2025 16:18:19 +0530 Subject: [PATCH 4/4] Update Jenkinsfile --- Jenkinsfile | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0bb7cf2..7aa35ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,16 +1,22 @@ -pipeline { - agent tomcat - stages { - stage('git Checkout') { - steps { - git branch: 'main', url: 'https://github.com/Ravichandu-git/java-example.git' - } - } - - stage('Build') { - steps { - sh 'mvn clean install' - } - } - } +pipeline{ + agent {label 'tomcat'} + stages{ + stage('Git Checkout Stage'){ + steps{ + git branch: 'main', url: 'https://github.com/Ravichandu-git/java-example.git' + } + } + stage('Build Stage'){ + steps{ + sh 'mvn clean install' + } + } + stage('SonarQube Analysis Stage') { + steps{ + withSonarQubeEnv('sonarqube-server') { + sh "mvn clean verify sonar:sonar" + } + } + } + } }