From 3c21c02cb17bfacb690ebeee26b74c1d16c27b8a Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:10:30 +0530 Subject: [PATCH 01/39] Delete .classpath --- .classpath | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .classpath diff --git a/.classpath b/.classpath deleted file mode 100644 index eb4c411..0000000 --- a/.classpath +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 7a53259a3d5fdc43c7ba510d461b6e74d93a0bfe Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:11:02 +0530 Subject: [PATCH 02/39] Delete .project --- .project | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .project diff --git a/.project b/.project deleted file mode 100644 index e2c3574..0000000 --- a/.project +++ /dev/null @@ -1,37 +0,0 @@ - - - devOpsWeb - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.jsdt.core.jsNature - - From fed6fcb16b67e88ac6d187930d3f1fe602a73206 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:11:19 +0530 Subject: [PATCH 03/39] 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 2aa47b2d506bdd23698cfd6e40a45df90704b0f9 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:11:30 +0530 Subject: [PATCH 04/39] 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 7a27e328c3a9eb10edb41ad55795a745a6efe906 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:11:40 +0530 Subject: [PATCH 05/39] 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 902b2a3870e451d60a358d4ef0afc7c44147214e Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:12:15 +0530 Subject: [PATCH 06/39] 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 cc3ed8693b714bba982899534ceabec24700fd3f Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:39:25 +0530 Subject: [PATCH 07/39] Update and rename Jenkinsfile_1.0 to Jenkinsfile --- Jenkinsfile_1.0 => Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename Jenkinsfile_1.0 => Jenkinsfile (72%) diff --git a/Jenkinsfile_1.0 b/Jenkinsfile similarity index 72% rename from Jenkinsfile_1.0 rename to Jenkinsfile index d030fb6..fa0f99f 100644 --- a/Jenkinsfile_1.0 +++ b/Jenkinsfile @@ -5,8 +5,7 @@ pipeline { 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') + string(name: 'tomcat_stag', defaultValue: '13.232.236.86', description: 'Node1-Remote Staging Server1') } triggers { @@ -36,7 +35,7 @@ stages{ stage ("Deploy to Production"){ steps { - sh "scp **/*.war jenkins@${params.tomcat_prod}:/usr/share/tomcat/webapps/" + echo 'This is just a demo on Production server.' } } } From 3d12db906761ccfbf84444c044c5313cbee7169c Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:54:41 +0530 Subject: [PATCH 08/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fa0f99f..c077c7a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any tools { - maven 'localMaven' + maven 'local_maven' } parameters { string(name: 'tomcat_stag', defaultValue: '13.232.236.86', description: 'Node1-Remote Staging Server1') From 1600723bdb291ce4e7d0f9bed2820fe053b44d59 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:59:24 +0530 Subject: [PATCH 09/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c077c7a..43b582a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh "scp **/*.war jenkins@${params.tomcat_stag}:/usr/share/tomcat/webapps/" + sh "scp **/*.war root@${params.tomcat_stag}:/usr/share/tomcat/webapps/" } } From 2638bd7c478932e28a4cc74b8d8bdb0c86fe9c20 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 10:05:19 +0530 Subject: [PATCH 10/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 43b582a..a6e3913 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh "scp **/*.war root@${params.tomcat_stag}:/usr/share/tomcat/webapps/" + sh "scp **/*.war root@${params.tomcat_stag}:/opt/tomcat/webapps/" } } From 8077fd22f3440eefe7114731215a8eb94840eb24 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 10:16:01 +0530 Subject: [PATCH 11/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a6e3913..4f0fb34 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh "scp **/*.war root@${params.tomcat_stag}:/opt/tomcat/webapps/" + sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" } } From 2fa1836203fd6330f5099038f79ac0c6a0de194a Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 10:25:15 +0530 Subject: [PATCH 12/39] Update Jenkinsfile --- Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4f0fb34..4d626fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,6 +11,12 @@ pipeline { triggers { pollSCM('* * * * *') } + environments { + fname = "Ranjit" + lname = "Swain" + version = "1.2" + system = "Dev" + } stages{ stage('Build'){ @@ -29,7 +35,9 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" + //sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" + echo "This is made by ${env.fname} ${env.lname}" + echo "it's running on ${env.system} and the version is ${env.version} } } From e76a94ad7b5e78e0ec7ee6dec01a0e74492bc74e Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 10:26:39 +0530 Subject: [PATCH 13/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4d626fc..e11c260 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,7 +37,7 @@ stages{ steps { //sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" echo "This is made by ${env.fname} ${env.lname}" - echo "it's running on ${env.system} and the version is ${env.version} + echo "it's running on ${env.system} and the version is ${env.version}" } } From 797f6d24e0a6465dd2846f1a57a2ad7d1275fb5c Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sun, 7 Aug 2022 10:27:43 +0530 Subject: [PATCH 14/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e11c260..1d67700 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { triggers { pollSCM('* * * * *') } - environments { + environment { fname = "Ranjit" lname = "Swain" version = "1.2" From 8d03b4a8b836803ee1d7caeb1222471568d7321f Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Mon, 8 Aug 2022 18:41:05 +0530 Subject: [PATCH 15/39] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1d67700..0e1c02a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,6 +38,7 @@ stages{ //sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" echo "This is made by ${env.fname} ${env.lname}" echo "it's running on ${env.system} and the version is ${env.version}" + deploy adapters: [tomcat7(credentialsId: '58cccd86-7ec3-4a1a-8dfd-8f664aff0392', path: '', url: 'http://3.108.221.41:8282/')], contextPath: '/opt/tomcat/webapps', war: '**/*.war' } } From a313c2751158950842c90b9d41451f6217719c93 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 12 Aug 2022 23:15:09 +0530 Subject: [PATCH 16/39] Update Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0e1c02a..2cce0fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,10 +35,9 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - //sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" + sh 'scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/' echo "This is made by ${env.fname} ${env.lname}" echo "it's running on ${env.system} and the version is ${env.version}" - deploy adapters: [tomcat7(credentialsId: '58cccd86-7ec3-4a1a-8dfd-8f664aff0392', path: '', url: 'http://3.108.221.41:8282/')], contextPath: '/opt/tomcat/webapps', war: '**/*.war' } } From a78524235d19153c783d383b3d8b38d5e43d210d Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 12 Aug 2022 23:15:44 +0530 Subject: [PATCH 17/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2cce0fc..6d56fc2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { maven 'local_maven' } parameters { - string(name: 'tomcat_stag', defaultValue: '13.232.236.86', description: 'Node1-Remote Staging Server1') + string(name: 'tomcat_stag', defaultValue: '13.233.166.195', description: 'Node1-Remote Staging Server1') } triggers { From 04fb6cd49416c5bc0c000b5e53f197e1d3d181d6 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 12 Aug 2022 23:18:18 +0530 Subject: [PATCH 18/39] Update Jenkinsfile --- Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6d56fc2..6702cc4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,10 +7,6 @@ pipeline { parameters { string(name: 'tomcat_stag', defaultValue: '13.233.166.195', description: 'Node1-Remote Staging Server1') } - - triggers { - pollSCM('* * * * *') - } environment { fname = "Ranjit" lname = "Swain" @@ -35,7 +31,7 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh 'scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/' + sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" echo "This is made by ${env.fname} ${env.lname}" echo "it's running on ${env.system} and the version is ${env.version}" } From 384bd03dd8c728fdd9a6847fde66b781276c84bd Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 12 Aug 2022 23:21:28 +0530 Subject: [PATCH 19/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6702cc4..3f04fb9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" + sh "scp **/*.war root@${params.tomcat_stag}:/opt/tomcat/webapps/" echo "This is made by ${env.fname} ${env.lname}" echo "it's running on ${env.system} and the version is ${env.version}" } From 3a51958c293950d9c97ab52bc3c8bb86896caa5b Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 12 Aug 2022 23:51:37 +0530 Subject: [PATCH 20/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f04fb9..6702cc4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh "scp **/*.war root@${params.tomcat_stag}:/opt/tomcat/webapps/" + sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" echo "This is made by ${env.fname} ${env.lname}" echo "it's running on ${env.system} and the version is ${env.version}" } From 3751adb2f0d4bf00b3a22dfd0369f263325388ce Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:23:04 +0530 Subject: [PATCH 21/39] Update Jenkinsfile --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6702cc4..a7e509d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,9 +4,6 @@ pipeline { tools { maven 'local_maven' } - parameters { - string(name: 'tomcat_stag', defaultValue: '13.233.166.195', description: 'Node1-Remote Staging Server1') - } environment { fname = "Ranjit" lname = "Swain" @@ -31,9 +28,10 @@ stages{ parallel{ stage ('Deploy to Staging'){ steps { - sh "scp **/*.war jenkins@${params.tomcat_stag}:/opt/tomcat/webapps/" + echo "This is made by ${env.fname} ${env.lname}" echo "it's running on ${env.system} and the version is ${env.version}" + deploy adapters: [tomcat7(credentialsId: '58cccd86-7ec3-4a1a-8dfd-8f664aff0392', path: '', url: 'http://13.127.210.164:8282/')], contextPath: null, war: '**/*.war' } } From 8f9ff83900ae7ec1a068e9a4aa90c221e36b2e0e Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:26:13 +0530 Subject: [PATCH 22/39] 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 1b85a5d..f6a6f0b 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.0 - Batch4

+

DevOps class - Ranjit Swain - Version: 2.5

Just an example! - Webhook

From 1cfe75bc94def04b072fe0a64e2ee63b9916520f Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:30:45 +0530 Subject: [PATCH 23/39] Create build.cnf --- build.cnf | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 build.cnf diff --git a/build.cnf b/build.cnf new file mode 100644 index 0000000..4f415ab --- /dev/null +++ b/build.cnf @@ -0,0 +1,4 @@ +deploy.App.Name=devOpsWeb +deploy.env=sandBox +deploy.type=prod +deploy.version=1.2.1 From ef4dffe8914ef8448d39f36b2f0c767a176936a6 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:37:47 +0530 Subject: [PATCH 24/39] Update Jenkinsfile --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index a7e509d..b31f0c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,6 +38,9 @@ stages{ stage ("Deploy to Production"){ steps { echo 'This is just a demo on Production server.' + props = readProperties file: 'build.cnf' + + echo "Current Version ${props['deploy.version']}" } } } From cc75b012e845dc22d2e89bdca0a3a20bc4fc4c1d Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:39:00 +0530 Subject: [PATCH 25/39] Update Jenkinsfile --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b31f0c8..b6bd81b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,8 +38,9 @@ stages{ stage ("Deploy to Production"){ steps { echo 'This is just a demo on Production server.' - props = readProperties file: 'build.cnf' - + script{ + props = readProperties file: 'build.cnf' + } echo "Current Version ${props['deploy.version']}" } } From e41bbb76c400219433ff0bf27d1df04de3c6ff56 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:40:45 +0530 Subject: [PATCH 26/39] Update build.cnf --- build.cnf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cnf b/build.cnf index 4f415ab..036777f 100644 --- a/build.cnf +++ b/build.cnf @@ -1,4 +1,4 @@ deploy.App.Name=devOpsWeb deploy.env=sandBox deploy.type=prod -deploy.version=1.2.1 +deploy.version=1.2.2 From d86dd478933f2c339658ea3c2f6b35612323169b Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:55:35 +0530 Subject: [PATCH 27/39] 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 f6a6f0b..2a87d98 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.5

+

DevOps class - Ranjit Swain - Version: 2.6

Just an example! - Webhook

From e39fe1e71fc1496d98c704df2d1f292fa938979e Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 13 Aug 2022 09:56:36 +0530 Subject: [PATCH 28/39] 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 2a87d98..4897854 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.6

+

DevOps class - Ranjit Swain - Version: 2.6.2

Just an example! - Webhook

From 4f646c82f49ad05468178742c33dd056490913d4 Mon Sep 17 00:00:00 2001 From: Ranjit Swain Date: Sat, 25 Feb 2023 11:26:18 +0530 Subject: [PATCH 29/39] Jenkinsfile updated --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b6bd81b..9a24917 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any tools { - maven 'local_maven' + maven 'localMaven' } environment { fname = "Ranjit" @@ -31,17 +31,17 @@ stages{ echo "This is made by ${env.fname} ${env.lname}" echo "it's running on ${env.system} and the version is ${env.version}" - deploy adapters: [tomcat7(credentialsId: '58cccd86-7ec3-4a1a-8dfd-8f664aff0392', path: '', url: 'http://13.127.210.164:8282/')], contextPath: null, war: '**/*.war' + deploy adapters: [tomcat7(credentialsId: 'StagingTomcatServer', path: '', url: 'http://3.110.179.112:8080/')], contextPath: null, war: '**/*.war' } } - stage ("Deploy to Production"){ + stage ("Deploy to Staging2"){ steps { echo 'This is just a demo on Production server.' - script{ + /*script{ props = readProperties file: 'build.cnf' } - echo "Current Version ${props['deploy.version']}" + echo "Current Version ${props['deploy.version']}"*/ } } } From 460e582b1385dc2354b2c36d4a6426e6418bd5af Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Sat, 25 Feb 2023 11:33:20 +0530 Subject: [PATCH 30/39] 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 4897854..e6b61b2 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.6.2

+

DevOps class - Ranjit Swain - Version: 2.7

Just an example! - Webhook

From 51ad5154f2d10b15d969dfb850e5302a7e31b9a8 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:32:27 +0530 Subject: [PATCH 31/39] Update Jenkinsfile --- Jenkinsfile | 55 +++++++++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a24917..efa0958 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,47 +4,32 @@ pipeline { tools { maven 'localMaven' } - environment { - fname = "Ranjit" - lname = "Swain" - version = "1.2" - system = "Dev" - } - -stages{ - stage('Build'){ - steps { - sh 'mvn clean package' - } - post { - success { - echo 'Archiving the artifacts' - archiveArtifacts artifacts: '**/target/*.war' + stages{ + stage('Build Java Application'){ + steps { + sh 'mvn clean package' } - } - } - - stage ('Deployments'){ - parallel{ - stage ('Deploy to Staging'){ - steps { - - echo "This is made by ${env.fname} ${env.lname}" - echo "it's running on ${env.system} and the version is ${env.version}" - deploy adapters: [tomcat7(credentialsId: 'StagingTomcatServer', path: '', url: 'http://3.110.179.112:8080/')], contextPath: null, war: '**/*.war' + post { + success { + echo 'Archiving the artifacts' + archiveArtifacts artifacts: '**/target/*.war' } } - - stage ("Deploy to Staging2"){ - steps { - echo 'This is just a demo on Production server.' - /*script{ - props = readProperties file: 'build.cnf' + } + stage('Deployment to Staging server'){ + parallel{ + stage('Deploy to Tomcat Server1'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'tomcatcred', path: '', url: 'http://13.126.199.225:8080/')], contextPath: null, war: '**/*.war' + } + } + stage('Deploy to Tomcat Server2'){ + steps{ + echo "Deploying to Tomcat Server 2" } - echo "Current Version ${props['deploy.version']}"*/ } } + } } - } } From de1c4cb011a9614d852ef4ae31d9bbafbbe39430 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:47:18 +0530 Subject: [PATCH 32/39] 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 e6b61b2..6d40fc9 100644 --- a/src/main/webapp/template.xhtml +++ b/src/main/webapp/template.xhtml @@ -10,7 +10,7 @@ -

DevOps class - Ranjit Swain - Version: 2.7

+

DevOps class - Ranjit Swain - Version: 2.8 - Batch B11 Demo Class

Just an example! - Webhook

From 144717aaf8cecf14719d8848e66864c7d116ac59 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:59:20 +0530 Subject: [PATCH 33/39] Update Jenkinsfile --- Jenkinsfile | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index efa0958..8c30c61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,34 +2,25 @@ pipeline { agent any tools { + jdk 'java8' maven 'localMaven' } + parameters { + string(name: 'environ', defaultValue: '[Dev, pre-prod, prod]', description: 'Environment List') + } + environment { + fname = "Ranjit" + lname = "Swain" + version = "1.2" + system = "Dev" + } + stages{ stage('Build Java Application'){ steps { - sh 'mvn clean package' - } - post { - success { - echo 'Archiving the artifacts' - archiveArtifacts artifacts: '**/target/*.war' - } - } - } - stage('Deployment to Staging server'){ - parallel{ - stage('Deploy to Tomcat Server1'){ - steps{ - deploy adapters: [tomcat9(credentialsId: 'tomcatcred', path: '', url: 'http://13.126.199.225:8080/')], contextPath: null, war: '**/*.war' - } - } - stage('Deploy to Tomcat Server2'){ - steps{ - echo "Deploying to Tomcat Server 2" - } - } + echo "My name is ${fname}" + echo "Executed from ${environ}" } - } } } From 15e5ff628f9e5be85e044eea6d0bb79f1ac65eeb Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:04:27 +0530 Subject: [PATCH 34/39] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8c30c61..6520b33 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { stage('Build Java Application'){ steps { echo "My name is ${fname}" - echo "Executed from ${environ}" + echo "Executed from ${params.environ}" } } } From c0d89cf0e59e3e47e98aef8246a68c13d431c1f3 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:05:52 +0530 Subject: [PATCH 35/39] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6520b33..3c7c1bb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { maven 'localMaven' } parameters { - string(name: 'environ', defaultValue: '[Dev, pre-prod, prod]', description: 'Environment List') + string(name: 'environ', defaultValue: ['Dev', 'pre-prod', 'prod'], description: 'Environment List') } environment { fname = "Ranjit" @@ -19,7 +19,7 @@ pipeline { stage('Build Java Application'){ steps { echo "My name is ${fname}" - echo "Executed from ${params.environ}" + echo "Executed from ${environ}" } } } From b9128ef88cf47bbd181d141abf4e440a38ab3fe3 Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:09:56 +0530 Subject: [PATCH 36/39] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3c7c1bb..beacf2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { maven 'localMaven' } parameters { - string(name: 'environ', defaultValue: ['Dev', 'pre-prod', 'prod'], description: 'Environment List') + choice(name: 'environ', choices: ['Dev', 'pre-prod', 'prod'], description: 'Environment List') } environment { fname = "Ranjit" @@ -19,7 +19,7 @@ pipeline { stage('Build Java Application'){ steps { echo "My name is ${fname}" - echo "Executed from ${environ}" + echo "Executed from ${params.environ}" } } } From 51acebc7389fd7a851f6ca358bc54fb414c4bbaf Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:16:14 +0530 Subject: [PATCH 37/39] Update Jenkinsfile --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index beacf2c..137f92a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,8 @@ pipeline { } parameters { choice(name: 'environ', choices: ['Dev', 'pre-prod', 'prod'], description: 'Environment List') + string(name: 'username', defaultValue: 'ranjitkumar', description: 'USer name') + password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password') } environment { fname = "Ranjit" @@ -20,6 +22,7 @@ pipeline { steps { echo "My name is ${fname}" echo "Executed from ${params.environ}" + echo "Executed by ${params.username} and password provided as ${params.PASSWORD}" } } } From c81e41076f077fc3ecf22019a4ba0507ed1c583c Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:02:31 +0530 Subject: [PATCH 38/39] Update Jenkinsfile --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 137f92a..15a31cd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,6 +24,11 @@ pipeline { echo "Executed from ${params.environ}" echo "Executed by ${params.username} and password provided as ${params.PASSWORD}" } + post { + success { + echo 'Post section triggered' + } + } } } } From 605ddeff6bc57f637509577628d51bc704f607de Mon Sep 17 00:00:00 2001 From: Ranjit Swain <58227542+ranjit4github@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:05:16 +0530 Subject: [PATCH 39/39] Update Jenkinsfile --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 15a31cd..0cf59d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,5 +30,15 @@ pipeline { } } } + stage('Deploy'){ + steps{ + echo "Deployment Triggered" + } + } + } + post { + success{ + echo "Pipeline completed successfully" } + } }