From c2d607249c8a4287069dd128062bc4197b0ad5e9 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 6 Jul 2022 07:42:18 +0530 Subject: [PATCH 01/14] Update index.jsp --- src/main/webapp/index.jsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index ead0e510f..ee54f1336 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -4,10 +4,11 @@

Hello World!

+

We are learning Deployment

It is now <%= new java.util.Date() %>

You are coming from <%= request.getRemoteAddr() %>

- \ No newline at end of file + From 8408a5ed59c81f1c24b943149defb553e521be2a Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 6 Jul 2022 07:54:55 +0530 Subject: [PATCH 02/14] Update index.jsp --- src/main/webapp/index.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index ee54f1336..fff03d914 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -4,7 +4,7 @@

Hello World!

-

We are learning Deployment

+

We are learning Deployment on 7-july

It is now <%= new java.util.Date() %>

From f621a8cc9310ce9fb6de33416668e99acad8b37d Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 6 Jul 2022 08:11:49 +0530 Subject: [PATCH 03/14] Update index.jsp --- src/main/webapp/index.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index fff03d914..f5cc14f79 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -4,7 +4,7 @@

Hello World!

-

We are learning Deployment on 7-july

+

We are learning Deployment on 7-july

It is now <%= new java.util.Date() %>

From d0e97645a39c056516964a8e7ee89c7e6b1a1005 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 6 Jul 2022 08:13:47 +0530 Subject: [PATCH 04/14] Update index.jsp --- src/main/webapp/index.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index f5cc14f79..4c8d1854b 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -4,7 +4,7 @@

Hello World!

-

We are learning Deployment on 7-july + We are learning Deployment on 7-july

It is now <%= new java.util.Date() %>

From a7cf52f233ea1c42e7a3c9a1bcc0a78632988774 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 6 Jul 2022 08:14:41 +0530 Subject: [PATCH 05/14] Update index.jsp --- src/main/webapp/index.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 4c8d1854b..2abb5ab8b 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -11,4 +11,4 @@

You are coming from <%= request.getRemoteAddr() %>

- + From ccad45e01d550108801aa9a0fbe19521f3992394 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 6 Jul 2022 08:15:46 +0530 Subject: [PATCH 06/14] Update index.jsp --- src/main/webapp/index.jsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 2abb5ab8b..9ba30e913 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -2,7 +2,7 @@ Hello World! - +

Hello World!

We are learning Deployment on 7-july

@@ -11,4 +11,5 @@

You are coming from <%= request.getRemoteAddr() %>

+ From f0118f422c05da89ac320bced6bf132d833d50a5 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 6 Jul 2022 08:16:34 +0530 Subject: [PATCH 07/14] Update index.jsp --- src/main/webapp/index.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 9ba30e913..bca6d1d94 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -2,7 +2,7 @@ Hello World! - +

Hello World!

We are learning Deployment on 7-july

From 1e6a7569332c148839f199e15b5bbf0c31827eb9 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Fri, 8 Jul 2022 11:28:06 +0530 Subject: [PATCH 08/14] Update index.jsp --- src/main/webapp/index.jsp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index bca6d1d94..7a4ead12a 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,10 +1,10 @@ -Hello World! +Hello DevOps -

Hello World!

- We are learning Deployment on 7-july +

Hello DevOps!

+

We are learning Deployment on 7-july

It is now <%= new java.util.Date() %>

From bb4994fd463c988f64693faeddc81bb0db7cb215 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Mon, 11 Jul 2022 08:05:31 +0530 Subject: [PATCH 09/14] Create Jenkinsfile --- Jenkinsfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..ca7c26192 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,27 @@ +pipeline { + agent { label 'maven' } + stages { + stage('checkout') { + steps { + sh 'rm -rf hello-world-war' + sh 'git clone https://github.com/Kavana147/hello-world-war.git' + } + } + stage('build') { + steps { + dir('hello-world-war') { + sh 'mvn package' + } + } + } + stage('deploy') { + steps { + sh 'sudo cp -r /home/jenslave/workspace/Pipelineexample/hello-world-war/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.64/webapps/' + sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/shutdown.sh' + sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/startup.sh' + } + + } + } + +} From 139508de8d7b6aaca84e879eac032e89ab8417a4 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Mon, 11 Jul 2022 08:13:10 +0530 Subject: [PATCH 10/14] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index ca7c26192..e54b6a854 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,6 +19,7 @@ pipeline { sh 'sudo cp -r /home/jenslave/workspace/Pipelineexample/hello-world-war/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.64/webapps/' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/shutdown.sh' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/startup.sh' + sh 'echo "Successfully deployed"' } } From 8c88b0e3d32bf7b38a4288e6c8624db2e08d8ea9 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 13 Jul 2022 07:05:12 -0700 Subject: [PATCH 11/14] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e54b6a854..f81d67f9d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent { label 'maven' } + agent any stages { stage('checkout') { steps { From 7fbab4ac4c7f6d7e7f635446e8e668b07efb1768 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 13 Jul 2022 08:50:10 -0700 Subject: [PATCH 12/14] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f81d67f9d..5fe05e926 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('deploy') { steps { - sh 'sudo cp -r /home/jenslave/workspace/Pipelineexample/hello-world-war/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.64/webapps/' + sh 'sudo cp -r /var/lib/jenkins/workspace/Multipipeline_pipeline2/hello-world-war/target/hello-world-war-1.0.0 /opt/apache-tomcat-9.0.64/webapps/' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/shutdown.sh' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/startup.sh' sh 'echo "Successfully deployed"' From 7a74d507afb4596a8945086618f7efba6557bb52 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 13 Jul 2022 08:51:33 -0700 Subject: [PATCH 13/14] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5fe05e926..51a50304e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('deploy') { steps { - sh 'sudo cp -r /var/lib/jenkins/workspace/Multipipeline_pipeline2/hello-world-war/target/hello-world-war-1.0.0 /opt/apache-tomcat-9.0.64/webapps/' + sh 'sudo -S cp -r /var/lib/jenkins/workspace/Multipipeline_pipeline2/hello-world-war/target/hello-world-war-1.0.0 /opt/apache-tomcat-9.0.64/webapps/' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/shutdown.sh' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/startup.sh' sh 'echo "Successfully deployed"' From 7f95cedff247d41ea48495aefecddfe0ea631315 Mon Sep 17 00:00:00 2001 From: Kavana147 <108313466+Kavana147@users.noreply.github.com> Date: Wed, 13 Jul 2022 08:56:10 -0700 Subject: [PATCH 14/14] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 51a50304e..70bbaa2ec 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('deploy') { steps { - sh 'sudo -S cp -r /var/lib/jenkins/workspace/Multipipeline_pipeline2/hello-world-war/target/hello-world-war-1.0.0 /opt/apache-tomcat-9.0.64/webapps/' + sh 'sudo cp -r /var/lib/jenkins/workspace/Multipipeline_pipeline2/hello-world-war/target/hello-world-war-1.0.0.war /opt/apache-tomcat-9.0.64/webapps/' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/shutdown.sh' sh 'sudo sh /opt/apache-tomcat-9.0.64/bin/startup.sh' sh 'echo "Successfully deployed"'