From e65b913b223cd879c20971ad21e70fc7cb7cb952 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:13:10 +0530 Subject: [PATCH 01/21] Delete Dockerfile --- Dockerfile | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 88fe618..0000000 --- a/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM tomcat:8.0 - -ADD ./target/*.war /usr/local/tomcat/webapps/ - -EXPOSE 8080 - -WORKDIR /usr/local/tomcat/webapps/ - -CMD ["catalina.sh", "run"] - From f0f9cbbb8ba17b31b554a0fbfcf98a44d6fecfe4 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:13:41 +0530 Subject: [PATCH 02/21] Delete Jenkinsfile --- Jenkinsfile | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index f722447..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,34 +0,0 @@ -pipeline { - agent any - - tools { - maven 'local_maven' - } - parameters { - string(name: 'staging_server', defaultValue: '13.232.37.20', description: 'Remote Staging Server') - } - -stages{ - stage('Build'){ - steps { - sh 'mvn clean package' - } - post { - success { - echo 'Archiving the artifacts' - archiveArtifacts artifacts: '**/target/*.war' - } - } - } - - stage ('Deployments'){ - parallel{ - stage ("Deploy to Staging"){ - steps { - sh "scp -v -o StrictHostKeyChecking=no **/*.war root@${params.staging_server}:/opt/tomcat/webapps/" - } - } - } - } - } -} From 11d68e1750fda5421e93e4ff9e47ca4665b4c1e2 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:14:05 +0530 Subject: [PATCH 03/21] Delete Jenkinsfile_1.0 --- Jenkinsfile_1.0 | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 Jenkinsfile_1.0 diff --git a/Jenkinsfile_1.0 b/Jenkinsfile_1.0 deleted file mode 100644 index d030fb6..0000000 --- a/Jenkinsfile_1.0 +++ /dev/null @@ -1,45 +0,0 @@ -pipeline { - agent any - - tools { - maven 'localMaven' - } - parameters { - string(name: 'tomcat_stag', defaultValue: '13.59.108.184', description: 'Node1-Remote Staging Server') - string(name: 'tomcat_prod', defaultValue: '18.219.228.98', description: 'Node2-Remote Production Server') - } - - triggers { - pollSCM('* * * * *') - } - -stages{ - stage('Build'){ - steps { - sh 'mvn clean package' - } - post { - success { - echo 'Archiving the artifacts' - archiveArtifacts artifacts: '**/target/*.war' - } - } - } - - stage ('Deployments'){ - parallel{ - stage ('Deploy to Staging'){ - steps { - sh "scp **/*.war jenkins@${params.tomcat_stag}:/usr/share/tomcat/webapps/" - } - } - - stage ("Deploy to Production"){ - steps { - sh "scp **/*.war jenkins@${params.tomcat_prod}:/usr/share/tomcat/webapps/" - } - } - } - } - } -} From 083947bad0c2d3b20e981903e12267e1ddfa7dcd Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:14:33 +0530 Subject: [PATCH 04/21] Delete Jenkinsfile_Docker_Local --- Jenkinsfile_Docker_Local | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 Jenkinsfile_Docker_Local diff --git a/Jenkinsfile_Docker_Local b/Jenkinsfile_Docker_Local deleted file mode 100644 index 7f7c1cc..0000000 --- a/Jenkinsfile_Docker_Local +++ /dev/null @@ -1,14 +0,0 @@ -pipeline{ - agent any - tools { - maven 'localMaven' - } - stages{ - stage('Build'){ - steps{ - sh 'mvn clean package' - sh "docker build . -t tomcatwebapp:${env.BUILD_ID}" - } - } - } -} From 0baf6f8dd58a1f62f2c910b64449e1abbbbb099f Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:14:56 +0530 Subject: [PATCH 05/21] Delete Jenkinsfile_Docker_Remote --- Jenkinsfile_Docker_Remote | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Jenkinsfile_Docker_Remote diff --git a/Jenkinsfile_Docker_Remote b/Jenkinsfile_Docker_Remote deleted file mode 100644 index cf138a7..0000000 --- a/Jenkinsfile_Docker_Remote +++ /dev/null @@ -1,15 +0,0 @@ -pipeline{ - agent any - tools { - maven 'localMaven' - } - stages{ - stage('Build'){ - steps{ - sh 'mvn clean package' - sh 'scp Dockerfile centos@3.17.61.170' - sh 'ssh centos@3.17.61.170 "docker build . -t tomcatwebapp:${env.BUILD_ID}"' - } - } - } -} From dfedd422cec2a283427bb34d4f49f9716aebbf17 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:36:06 +0530 Subject: [PATCH 06/21] Create Jenkinsfile --- Jenkinsfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..93d1481 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,33 @@ +pipeline { + agent any + + tools { + maven 'localMaven' + jdk 'localJava' + } + environment { + fname = "Ranjit" + lname = "Swain" + version = "1.2" + system = "Test" + } + +stages{ + stage('Build'){ + steps { + sh 'mvn clean package' + } + post { + success { + echo 'Archiving the artifacts' + archiveArtifacts artifacts: '**/target/*.war' + } + } + } + stage ('Deploy to Staging1'){ + steps { + echo 'This is just a demo on Staging1 server.' + } + } + } +} From 3bf1d762558bb51805a9030cadbde4266def066d Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:59:16 +0530 Subject: [PATCH 07/21] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 93d1481..97debee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,9 +24,9 @@ stages{ } } } - stage ('Deploy to Staging1'){ + stage ('Deploy to Staging'){ steps { - echo 'This is just a demo on Staging1 server.' + echo 'This is just a demo on Staging server.' } } } From 680d2b8327608691b155d71cddfbb864f35991b7 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 1 Apr 2025 21:16:20 +0530 Subject: [PATCH 08/21] Update template.xhtml --- src/main/webapp/template.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/template.xhtml b/src/main/webapp/template.xhtml index 8151566..efd6a0f 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -11,7 +11,7 @@

DevOps class - Ranjit Swain - Version: 2.7.2 - Batch7

-

Just an example! - Webhook

+

Just an example! - Webhook- devopsB13

From f24a9598a9566cd007bb2343ee0779f7f480444a Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Wed, 2 Apr 2025 21:14:55 +0530 Subject: [PATCH 09/21] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 97debee..607ab02 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,7 @@ pipeline { - agent any + agent { + label 'APPBUILD' + } tools { maven 'localMaven' From 07d68cb18a4b89a65da3344b9ebacfb8a8bc2939 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 8 Apr 2025 20:42:03 +0530 Subject: [PATCH 10/21] Update Jenkinsfile --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 607ab02..6f4d1c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,6 +24,9 @@ stages{ echo 'Archiving the artifacts' archiveArtifacts artifacts: '**/target/*.war' } + failure{ + emailext attachLog: true, body: 'Build failed', subject: 'Build Failed - ${BUILDNUMBER}', to: 'ranjitswain@gmail.com' + } } } stage ('Deploy to Staging'){ From bdba9e6b1c5066eccb970a9d0f05963382008c65 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Wed, 16 Apr 2025 21:00:26 +0530 Subject: [PATCH 11/21] Update Jenkinsfile --- Jenkinsfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f4d1c4..1e8459e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,12 @@ pipeline { agent { - label 'APPBUILD' + label 'JAVA_BUILD_SERVER' } tools { maven 'localMaven' jdk 'localJava' } - environment { - fname = "Ranjit" - lname = "Swain" - version = "1.2" - system = "Test" - } stages{ stage('Build'){ @@ -31,7 +25,7 @@ stages{ } stage ('Deploy to Staging'){ steps { - echo 'This is just a demo on Staging server.' + deploy adapters: [tomcat9(credentialsId: 'tomcat', path: '', url: 'http://13.127.187.179:8080/')], contextPath: null, war: '**/*.war' } } } From 6ed29c30bbad5dba8c0768c50e715f7622db648e Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Wed, 16 Apr 2025 21:11:02 +0530 Subject: [PATCH 12/21] Update template.xhtml --- src/main/webapp/template.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/template.xhtml b/src/main/webapp/template.xhtml index efd6a0f..62254ec 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.7.2 - Batch7

+

DevOps class - Ranjit Swain - Version: 2.7.13 - Batch13

Just an example! - Webhook- devopsB13

From c489fd81d460192c6acad92ceb902d1237e9d2ba Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Wed, 16 Apr 2025 21:14:07 +0530 Subject: [PATCH 13/21] Update template.xhtml --- src/main/webapp/template.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/template.xhtml b/src/main/webapp/template.xhtml index 62254ec..8edec41 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.7.13 - Batch13

+

DevOps class - Ranjit Swain - Version: 2.8.1 - Batch13

Just an example! - Webhook- devopsB13

From 0799547448d5f2d533397de6bb3be1238ad4676d Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:40:18 +0530 Subject: [PATCH 14/21] Update Jenkinsfile --- Jenkinsfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1e8459e..39211dd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +@Library('demoSharedLib') _ + pipeline { agent { label 'JAVA_BUILD_SERVER' @@ -11,7 +13,9 @@ pipeline { stages{ stage('Build'){ steps { - sh 'mvn clean package' + script{ + build() + } } post { success { @@ -25,7 +29,10 @@ stages{ } stage ('Deploy to Staging'){ steps { - deploy adapters: [tomcat9(credentialsId: 'tomcat', path: '', url: 'http://13.127.187.179:8080/')], contextPath: null, war: '**/*.war' + //deploy adapters: [tomcat9(credentialsId: 'tomcat', path: '', url: 'http://13.127.187.179:8080/')], contextPath: null, war: '**/*.war' + script{ + deploy() + } } } } From 92b87542b1bf49099883c7d8b00a9c56ca83f3d4 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:49:45 +0530 Subject: [PATCH 15/21] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 39211dd..dfd34ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library('demoSharedLib') _ +@Library ('demoSharedLib')_ pipeline { agent { From a0759af8fb37b66868eccc5561a69f421fd4b04e Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:59:22 +0530 Subject: [PATCH 16/21] Update Jenkinsfile --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dfd34ea..a5a234c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,7 @@ @Library ('demoSharedLib')_ pipeline { - agent { - label 'JAVA_BUILD_SERVER' - } + agent any tools { maven 'localMaven' From 8b099043357b972fd963b7c1c7d61209e6c3ccac Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 18 Apr 2025 21:11:34 +0530 Subject: [PATCH 17/21] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a5a234c..b04b9a5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ stages{ stage('Build'){ steps { script{ - build() + build.java() } } post { From 337fb721702ca24d11a28e4e63890c806c5d05fd Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 18 Apr 2025 21:16:33 +0530 Subject: [PATCH 18/21] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b04b9a5..00c4a13 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library ('demoSharedLib')_ +@Library ('demoSharedLib@feature/demo')_ pipeline { agent any From b1b8d5f65c2aa837c2ad6a3befad13afab46ff86 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Thu, 15 May 2025 11:35:24 +0530 Subject: [PATCH 19/21] Update and rename Jenkinsfile to Jenkinsfile_SharedLib --- Jenkinsfile => Jenkinsfile_SharedLib | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Jenkinsfile => Jenkinsfile_SharedLib (100%) diff --git a/Jenkinsfile b/Jenkinsfile_SharedLib similarity index 100% rename from Jenkinsfile rename to Jenkinsfile_SharedLib From 004cc429ea5e2ea433d42e16a92bc88fcdad8f90 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Thu, 15 May 2025 11:36:52 +0530 Subject: [PATCH 20/21] Create Jenkinsfile --- Jenkinsfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..ec3a66f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,31 @@ +pipeline { + agent any + + tools { + maven 'localMaven' + jdk 'localJava' + } + +stages{ + stage('Build'){ + steps { + sh 'mvn clean install' + } + post { + success { + echo 'Archiving the artifacts' + archiveArtifacts artifacts: '**/target/*.war' + } + failure{ + emailext attachLog: true, body: 'Build failed', subject: 'Build Failed - ${BUILDNUMBER}', to: 'ranjitswain@gmail.com' + } + } + } + stage ('Deploy to Staging'){ + steps { + //deploy adapters: [tomcat9(credentialsId: 'tomcat', path: '', url: 'http://13.127.187.179:8080/')], contextPath: null, war: '**/*.war' + echo "Demo Deploy" + } + } + } +} From 191e1fa8105789724211b558ce1a5c1f5184ad62 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Thu, 15 May 2025 21:36:45 +0530 Subject: [PATCH 21/21] Update template.xhtml --- src/main/webapp/template.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/template.xhtml b/src/main/webapp/template.xhtml index 8edec41..ea383ad 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.8.1 - Batch13

+

DevOps class - Ranjit Swain - Version: 2.8.5 - Batch13

Just an example! - Webhook- devopsB13