From 27973204afcae11ddcbfaa42016a3cd4925d13ce Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Sat, 15 Mar 2025 20:26:15 +0530 Subject: [PATCH 01/11] Create JenkinsWebapps --- JenkinsWebapps | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 JenkinsWebapps diff --git a/JenkinsWebapps b/JenkinsWebapps new file mode 100644 index 0000000..2d6c87e --- /dev/null +++ b/JenkinsWebapps @@ -0,0 +1,34 @@ +pipeline{ + agent { + label 'Build' + } + stages { + stage('Checkout-stage') { + steps { + git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' + echo 'repo cloning' + } + } + + stage('Test-stage') { + steps { + echo 'This is a testcase and taken care while building an aritfact itself' + } + } + + stage('Build-stage') { + steps { + sh 'mvn clean package' + echo 'package distribution done' + } + } + + stage('Deploy-stage') { + steps { + sh 'sudo cp target/*.war /opt/tomcat/apache-tomcat-9.0.68/webapps' + echo 'copied java war file into tomcat webapps folder to configure web element integration' + } + } + + } +} From 1c914f6e2491d4c1f4b4d7bd0139fc3727853c8d Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Mon, 17 Mar 2025 17:34:45 +0530 Subject: [PATCH 02/11] Create JenkinsJayaSonar --- JenkinsJayaSonar | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 JenkinsJayaSonar diff --git a/JenkinsJayaSonar b/JenkinsJayaSonar new file mode 100644 index 0000000..bf5f5c3 --- /dev/null +++ b/JenkinsJayaSonar @@ -0,0 +1,22 @@ +pipeline{ + agent {label 'angular'} + stages{ + stage('Git Checkout Stage'){ + steps{ + git branch: 'main', url: 'https://github.com/Jayachandran-S7/java-example.git' + } + } + stage('Build Stage'){ + steps{ + sh 'mvn clean install' + } + } + stage('SonarQube Analysis Stage') { + steps{ + withSonarQubeEnv('sonar') { + sh "mvn clean verify sonar:sonar -Dsonar" + } + } + } + } +} From 469262aa856b34d4ab6a7751b1499d80779ebf93 Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Mon, 17 Mar 2025 17:56:29 +0530 Subject: [PATCH 03/11] Update JenkinsJayaSonar --- JenkinsJayaSonar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsJayaSonar b/JenkinsJayaSonar index bf5f5c3..28ca198 100644 --- a/JenkinsJayaSonar +++ b/JenkinsJayaSonar @@ -13,7 +13,7 @@ pipeline{ } stage('SonarQube Analysis Stage') { steps{ - withSonarQubeEnv('sonar') { + withSonarQubeEnv('SonarQube-Server') { sh "mvn clean verify sonar:sonar -Dsonar" } } From ca23f5549165bf381daa7a360690de9a7b015c94 Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Mon, 17 Mar 2025 17:59:25 +0530 Subject: [PATCH 04/11] Update JenkinsJayaSonar --- JenkinsJayaSonar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsJayaSonar b/JenkinsJayaSonar index 28ca198..3348ad4 100644 --- a/JenkinsJayaSonar +++ b/JenkinsJayaSonar @@ -14,7 +14,7 @@ pipeline{ stage('SonarQube Analysis Stage') { steps{ withSonarQubeEnv('SonarQube-Server') { - sh "mvn clean verify sonar:sonar -Dsonar" + sh "mvn clean verify sonar:sonar" } } } From 8c52e78cb7322975def473fda1684e53c9e08ef6 Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Mon, 17 Mar 2025 18:48:14 +0530 Subject: [PATCH 05/11] Update JenkinsJayaSonar --- JenkinsJayaSonar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsJayaSonar b/JenkinsJayaSonar index 3348ad4..28d8578 100644 --- a/JenkinsJayaSonar +++ b/JenkinsJayaSonar @@ -14,7 +14,7 @@ pipeline{ stage('SonarQube Analysis Stage') { steps{ withSonarQubeEnv('SonarQube-Server') { - sh "mvn clean verify sonar:sonar" + sh 'mvn clean verify sonar:sonar' } } } From 8e2065b8aa191602f309327dbf1d409ffad65bcb Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Mon, 17 Mar 2025 18:54:11 +0530 Subject: [PATCH 06/11] Update JenkinsJayaSonar --- JenkinsJayaSonar | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/JenkinsJayaSonar b/JenkinsJayaSonar index 28d8578..b8d0e04 100644 --- a/JenkinsJayaSonar +++ b/JenkinsJayaSonar @@ -2,10 +2,12 @@ pipeline{ agent {label 'angular'} stages{ stage('Git Checkout Stage'){ - steps{ - git branch: 'main', url: 'https://github.com/Jayachandran-S7/java-example.git' - } - } + steps { + git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' + echo 'repo cloning' + } + } + stage('Build Stage'){ steps{ sh 'mvn clean install' From 1566bede4c0ae225532428e9dd915a6fbf318455 Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Mon, 17 Mar 2025 19:07:53 +0530 Subject: [PATCH 07/11] Update JenkinsJayaSonar --- JenkinsJayaSonar | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/JenkinsJayaSonar b/JenkinsJayaSonar index b8d0e04..3348ad4 100644 --- a/JenkinsJayaSonar +++ b/JenkinsJayaSonar @@ -2,12 +2,10 @@ pipeline{ agent {label 'angular'} stages{ stage('Git Checkout Stage'){ - steps { - git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' - echo 'repo cloning' - } - } - + steps{ + git branch: 'main', url: 'https://github.com/Jayachandran-S7/java-example.git' + } + } stage('Build Stage'){ steps{ sh 'mvn clean install' @@ -16,7 +14,7 @@ pipeline{ stage('SonarQube Analysis Stage') { steps{ withSonarQubeEnv('SonarQube-Server') { - sh 'mvn clean verify sonar:sonar' + sh "mvn clean verify sonar:sonar" } } } From 6d563d46f619c681b6a44f0fd35176a84b269c98 Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Wed, 19 Mar 2025 22:44:29 +0530 Subject: [PATCH 08/11] Create JenkinsJFrogWebapps --- JenkinsJFrogWebapps | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 JenkinsJFrogWebapps diff --git a/JenkinsJFrogWebapps b/JenkinsJFrogWebapps new file mode 100644 index 0000000..eff1394 --- /dev/null +++ b/JenkinsJFrogWebapps @@ -0,0 +1,56 @@ +pipeline{ + agent { + label 'Build' + } + stages { + stage('Checkout-stage') { + steps { + git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' + echo 'repo cloning' + } + } + + stage('Test-stage') { + steps { + echo 'This is a testcase and taken care while building an aritfact itself' + } + } + + stage('Build-stage') { + steps { + sh 'mvn clean package' + echo 'package distribution done' + } + } + + stage('Deploy-stage') { + steps { + sh 'sudo cp target/*.war /opt/tomcat/apache-tomcat-9.0.68/webapps' + echo 'copied java war file into tomcat webapps folder to configure web element integration' + } + } + + stage ('push-to-artifactory') { + steps { + dir('/home/ubuntu/jenkins/workspace/demo-pipeline/target/works-with-heroku-1.0.war') + rtServer ( + id: 'server-1', + url: 'http://3.108.41.148:8081/artifactory', + credentialsId: 'jfrog-connection', + timeout: 300 + ) + rtUpload ( + serverId: 'server-1', + spec: '''{ + "files": [ + { + "pattern": "home/ubuntu/jenkins/workspace/demo-pipeline/target/works-with-heroku-1.0.war", + "target": "Maven/test1" + } + ] + }''', + ) + } + } + } +} From c86e7288d0826baee075c54696a22cfd6f0b5a5e Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Wed, 19 Mar 2025 22:46:32 +0530 Subject: [PATCH 09/11] Update JenkinsJFrogWebapps --- JenkinsJFrogWebapps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsJFrogWebapps b/JenkinsJFrogWebapps index eff1394..7dc10c9 100644 --- a/JenkinsJFrogWebapps +++ b/JenkinsJFrogWebapps @@ -1,6 +1,6 @@ pipeline{ agent { - label 'Build' + label 'angular' } stages { stage('Checkout-stage') { From 3ee600ad821e312905bd08ffa559ef2759828e07 Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Wed, 19 Mar 2025 23:34:09 +0530 Subject: [PATCH 10/11] Update JenkinsJFrogWebapps --- JenkinsJFrogWebapps | 98 ++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 55 deletions(-) diff --git a/JenkinsJFrogWebapps b/JenkinsJFrogWebapps index 7dc10c9..e2ca008 100644 --- a/JenkinsJFrogWebapps +++ b/JenkinsJFrogWebapps @@ -1,56 +1,44 @@ -pipeline{ - agent { - label 'angular' - } - stages { - stage('Checkout-stage') { - steps { - git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' - echo 'repo cloning' - } - } - - stage('Test-stage') { - steps { - echo 'This is a testcase and taken care while building an aritfact itself' - } - } - - stage('Build-stage') { - steps { - sh 'mvn clean package' - echo 'package distribution done' - } - } - - stage('Deploy-stage') { - steps { - sh 'sudo cp target/*.war /opt/tomcat/apache-tomcat-9.0.68/webapps' - echo 'copied java war file into tomcat webapps folder to configure web element integration' - } - } - - stage ('push-to-artifactory') { - steps { - dir('/home/ubuntu/jenkins/workspace/demo-pipeline/target/works-with-heroku-1.0.war') - rtServer ( - id: 'server-1', - url: 'http://3.108.41.148:8081/artifactory', - credentialsId: 'jfrog-connection', - timeout: 300 - ) - rtUpload ( - serverId: 'server-1', - spec: '''{ - "files": [ - { - "pattern": "home/ubuntu/jenkins/workspace/demo-pipeline/target/works-with-heroku-1.0.war", - "target": "Maven/test1" - } - ] - }''', - ) - } - } - } +pipeline { + agent { + label 'angular' + } + stages { + stage('Checkout-stage') { + steps { + git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' + echo 'repo cloning' + } + } + stage('Build-stage') { + steps { + sh 'mvn clean package' + echo 'package distribution done' + } + } + stage('push-to-artifactory') { + steps { + script { + // Upload to Artifactory + rtServer ( + id: 'server-1', + url: 'http://3.108.41.148:8081/artifactory', + credentialsId: 'jfrog-connection', + timeout: 300 + ) + rtUpload ( + serverId: 'server-1', + spec: '''{ + "files": [ + { + "pattern": "target/works-with-heroku-1.0.war", + "target": "Maven/test1.war" + } + ] + }''' + ) + } + echo 'Done with pushing artifact into JFrog Artifactory' + } + } + } } From 3c3ebe0b9d3d1e129d7eda044761076268af856e Mon Sep 17 00:00:00 2001 From: Jayachandran-S7 Date: Wed, 19 Mar 2025 23:35:56 +0530 Subject: [PATCH 11/11] Update JenkinsWebapps --- JenkinsWebapps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsWebapps b/JenkinsWebapps index 2d6c87e..df772ee 100644 --- a/JenkinsWebapps +++ b/JenkinsWebapps @@ -1,6 +1,6 @@ pipeline{ agent { - label 'Build' + label 'angular' } stages { stage('Checkout-stage') {