From f0144e2560b4de8cac88f3639ad529bb84fb947e Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:30:52 +0530 Subject: [PATCH 01/13] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_javawebapp108.yml | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/main_javawebapp108.yml diff --git a/.github/workflows/main_javawebapp108.yml b/.github/workflows/main_javawebapp108.yml new file mode 100644 index 000000000..e88eb8267 --- /dev/null +++ b/.github/workflows/main_javawebapp108.yml @@ -0,0 +1,53 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy JAR app to Azure Web App - javaWebApp108 + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Java version + uses: actions/setup-java@v1 + with: + java-version: '11' + + - name: Build with Maven + run: mvn clean install + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: java-app + path: '${{ github.workspace }}/target/*.jar' + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: java-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'javaWebApp108' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_CFC05EF8DE3741E8BAB5D2DCF1D1964B }} + package: '*.jar' From 591f89c643bf4d4a222c73ec87723724378e44ec Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:34:19 +0530 Subject: [PATCH 02/13] Update DemoApplication.java --- src/main/java/com/example/demo/DemoApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index f594b5bc3..1f9462288 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -15,6 +15,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello World!"; + return "Hello World, This is Azure talking to U!"; } } From c6612e74aeec257d9f8f7948d7dae437887ecf78 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:42:03 +0530 Subject: [PATCH 03/13] Code changes in DemoApplication.java --- src/main/java/com/example/demo/DemoApplication.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 1f9462288..b7c134460 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -10,6 +10,9 @@ public class DemoApplication { public static void main(String[] args) { + int a = 10; + int b = 20; + System.out.println("The sum of a and b is ", a + b); SpringApplication.run(DemoApplication.class, args); } From c6d1efbef4c62154065b1f424481c376f661cfe0 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:46:43 +0530 Subject: [PATCH 04/13] Code Change 1 DemoApplication.java --- src/main/java/com/example/demo/DemoApplication.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index b7c134460..357de522b 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -12,7 +12,8 @@ public class DemoApplication { public static void main(String[] args) { int a = 10; int b = 20; - System.out.println("The sum of a and b is ", a + b); + int c = a + b; + System.out.println("The sum of a and b is " + c); SpringApplication.run(DemoApplication.class, args); } From 6ff13a74ea4624fca47db37ba6090356714bd610 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:01:51 +0530 Subject: [PATCH 05/13] Code Change 2 DemoApplication.java --- src/main/java/com/example/demo/DemoApplication.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 357de522b..cdbd0e9ef 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -21,4 +21,9 @@ public static void main(String[] args) { String sayHello() { return "Hello World, This is Azure talking to U!"; } + + @RequestMapping("/") + String sayYes() { + return " The sum of a and b is 30 "; + } } From 2e8e31aebab8d3922dd6f05ababeffb760465427 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:08:11 +0530 Subject: [PATCH 06/13] Code Change 3 DemoApplication.java --- .../com/example/demo/DemoApplication.java | 34 +++++-------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index cdbd0e9ef..2fd67e9ee 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -1,29 +1,11 @@ package com.example.demo; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@SpringBootApplication -@RestController -public class DemoApplication { - - public static void main(String[] args) { - int a = 10; - int b = 20; - int c = a + b; - System.out.println("The sum of a and b is " + c); - SpringApplication.run(DemoApplication.class, args); - } - - @RequestMapping("/") - String sayHello() { - return "Hello World, This is Azure talking to U!"; - } - - @RequestMapping("/") - String sayYes() { - return " The sum of a and b is 30 "; +public class SumOfNumbers1 + { + public static void main(String args[]) + { + int n1 = 225, n2 = 115, sum; + sum = n1 + n2; + System.out.println("The sum of numbers is"+sum); + } } -} From 01e4faf1c835bddfe40c1c9f528c3632f1b613f7 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:10:54 +0530 Subject: [PATCH 07/13] Create SumOfNumbers1 --- src/main/java/com/example/demo/SumOfNumbers1 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/java/com/example/demo/SumOfNumbers1 diff --git a/src/main/java/com/example/demo/SumOfNumbers1 b/src/main/java/com/example/demo/SumOfNumbers1 new file mode 100644 index 000000000..2fd67e9ee --- /dev/null +++ b/src/main/java/com/example/demo/SumOfNumbers1 @@ -0,0 +1,11 @@ +package com.example.demo; + +public class SumOfNumbers1 + { + public static void main(String args[]) + { + int n1 = 225, n2 = 115, sum; + sum = n1 + n2; + System.out.println("The sum of numbers is"+sum); + } + } From 1034db4977e3a329fcce807c008fde15cc7f6783 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:13:09 +0530 Subject: [PATCH 08/13] Rename SumOfNumbers1 to SumOfNumbers1.java --- .../java/com/example/demo/{SumOfNumbers1 => SumOfNumbers1.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/java/com/example/demo/{SumOfNumbers1 => SumOfNumbers1.java} (100%) diff --git a/src/main/java/com/example/demo/SumOfNumbers1 b/src/main/java/com/example/demo/SumOfNumbers1.java similarity index 100% rename from src/main/java/com/example/demo/SumOfNumbers1 rename to src/main/java/com/example/demo/SumOfNumbers1.java From 956e0f466627f1334f1d8eaa0e5c076264defde0 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:15:48 +0530 Subject: [PATCH 09/13] Update 5 DemoApplication.java --- .../com/example/demo/DemoApplication.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 2fd67e9ee..c6eec869e 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -1,11 +1,24 @@ package com.example.demo; -public class SumOfNumbers1 - { - public static void main(String args[]) - { - int n1 = 225, n2 = 115, sum; - sum = n1 + n2; - System.out.println("The sum of numbers is"+sum); - } +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@SpringBootApplication +@RestController +public class DemoApplication { + + public static void main(String[] args) { + //int a = 10; + //int b = 20; + //int c = a + b; + //System.out.println("The sum of a and b is " + c); + SpringApplication.run(DemoApplication.class, args); + } + + @RequestMapping("/") + String sayHello() { + return "Hello World, This is Azure talking to U!"; } +} From 5d61ac7982ce01548b1256810c496a20f8b9f951 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:19:55 +0530 Subject: [PATCH 10/13] Update 6 DemoApplication.java --- src/main/java/com/example/demo/DemoApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index c6eec869e..8a03b85c6 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -19,6 +19,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello World, This is Azure talking to U!"; + return "Hello World, This is Azure talking to U\n How does this work?!"; } } From 1ba17eb429bf0b31e98fdf4c82abeae1558d0c04 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:35:01 +0530 Subject: [PATCH 11/13] Update 7 DemoApplication.java --- src/main/java/com/example/demo/DemoApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 8a03b85c6..1d9e97c05 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -13,7 +13,7 @@ public static void main(String[] args) { //int a = 10; //int b = 20; //int c = a + b; - //System.out.println("The sum of a and b is " + c); + System.out.println("The sum of a and b is 30"); SpringApplication.run(DemoApplication.class, args); } From 22a9d0578764abdac262610f9c63ee845b859a67 Mon Sep 17 00:00:00 2001 From: Shivam Singhal Date: Sat, 15 Jul 2023 18:59:47 +0530 Subject: [PATCH 12/13] changes in commit Test 1 --- src/main/java/com/example/demo/DemoApplication.java | 2 +- target/classes/application.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 target/classes/application.properties diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 1d9e97c05..704ff53c2 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -19,6 +19,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello World, This is Azure talking to U\n How does this work?!"; + return "Hello World, This is the code from Test branch!"; } } diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1 @@ + From cc9024d2a0da109b534f29dfa282accfa679c000 Mon Sep 17 00:00:00 2001 From: shivamsinghal1123 <127539395+shivamsinghal1123@users.noreply.github.com> Date: Sat, 15 Jul 2023 19:02:08 +0530 Subject: [PATCH 13/13] Add or update the Azure App Service build and deployment workflow config --- .../workflows/test_javawebapp108(staging).yml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/test_javawebapp108(staging).yml diff --git a/.github/workflows/test_javawebapp108(staging).yml b/.github/workflows/test_javawebapp108(staging).yml new file mode 100644 index 000000000..0ed622b11 --- /dev/null +++ b/.github/workflows/test_javawebapp108(staging).yml @@ -0,0 +1,53 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy JAR app to Azure Web App - javawebapp108 + +on: + push: + branches: + - test + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Java version + uses: actions/setup-java@v1 + with: + java-version: '11' + + - name: Build with Maven + run: mvn clean install + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: java-app + path: '${{ github.workspace }}/target/*.jar' + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Staging' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: java-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'javawebapp108' + slot-name: 'Staging' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_890D5BC8896448D7BBD64B19EF3719CC }} + package: '*.jar'