From 2f7bfa7a309d655a945e917da95e3c970810fd9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 16:50:52 +0000 Subject: [PATCH 01/14] Bump commons-io:commons-io from 2.7 to 2.14.0 Bumps commons-io:commons-io from 2.7 to 2.14.0. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 31bb2e3..b575d53 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ commons-io commons-io - 2.7 + 2.14.0 From 25e413be22a491ccc3c8a066b94b7b38d1696195 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Fri, 28 Mar 2025 12:54:23 -0400 Subject: [PATCH 02/14] custom .gitignore and log4j.properties --- .gitignore | 3 +++ src/main/resources/log4j.properties | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d16903 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +src/main/resources/conf.json +target \ No newline at end of file diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index 81f6f00..6967f5d 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -1,16 +1,16 @@ # Root logger option -log4j.rootLogger=INFO, stdout,file +log4j.rootLogger=DEBUG, stdout,file # Redirect log messages to console log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.EnhancedPatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS}{Etc/UTC} %tid %-5p %15.15c{1} %3.3L: %m %n +log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS}{America/New_York} %tid %-5p %15.15c{1} %3.3L: %m %n # Redirect log messages to a log file, support file rolling. log4j.appender.file=org.apache.log4j.DailyRollingFileAppender -log4j.appender.file.File=logs/application.log +log4j.appender.file.File=/home/AlmaRSA-PSB/logs/application.log log4j.appender.file.DatePattern='_'yyyy-MM-dd'.log' log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout -log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{Etc/UTC} %tid %-5p %15.15c{1} %3.3L: %m %n \ No newline at end of file +log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{America/New_York} %tid %-5p %15.15c{1} %3.3L: %m %n \ No newline at end of file From 933c96f9104c063a6be3799e239450787faf667e Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Tue, 27 May 2025 13:31:12 -0400 Subject: [PATCH 03/14] add application insights to log4j --- src/main/resources/log4j.properties | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index 6967f5d..1a91f64 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -1,5 +1,5 @@ # Root logger option -log4j.rootLogger=DEBUG, stdout,file +log4j.rootLogger=DEBUG, stdout,file, AppInsightsAppender # Redirect log messages to console log4j.appender.stdout=org.apache.log4j.ConsoleAppender @@ -13,4 +13,10 @@ log4j.appender.file=org.apache.log4j.DailyRollingFileAppender log4j.appender.file.File=/home/AlmaRSA-PSB/logs/application.log log4j.appender.file.DatePattern='_'yyyy-MM-dd'.log' log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout -log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{America/New_York} %tid %-5p %15.15c{1} %3.3L: %m %n \ No newline at end of file +log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{America/New_York} %tid %-5p %15.15c{1} %3.3L: %m %n + +# Application Insights Appender +log4j.appender.AppInsightsAppender=com.microsoft.applicationinsights.log4j.v1_2.ApplicationInsightsAppender +# Optional: Set a layout for the AppInsightsAppender if needed, though often not necessary +log4j.appender.AppInsightsAppender.layout=org.apache.log4j.EnhancedPatternLayout +log4j.appender.AppInsightsAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{America/New_York} %tid %-5p %15.15c{1} %3.3L: %m %n \ No newline at end of file From 532db7308eaef5b37a4decf271ee540b48eb6c33 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Tue, 27 May 2025 14:07:50 -0400 Subject: [PATCH 04/14] add application insights dependencies --- pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index b575d53..b769ec8 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,11 @@ + + com.microsoft.azure + applicationinsights-logging-log4j1_2 + 2.6.4 + com.sun.istack istack-commons-runtime @@ -77,6 +82,11 @@ 3.1.0 provided + + com.microsoft.azure + applicationinsights-web + 3.6.1 + org.marc4j From d4f616be70a64d41522587bd20fabedd10e59bd0 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Tue, 27 May 2025 14:12:52 -0400 Subject: [PATCH 05/14] reorganize pom.xml --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index b769ec8..68b5093 100644 --- a/pom.xml +++ b/pom.xml @@ -7,12 +7,17 @@ Alma Remote Storage App - + + com.microsoft.azure + applicationinsights-web + 3.6.1 + com.microsoft.azure applicationinsights-logging-log4j1_2 2.6.4 + com.sun.istack istack-commons-runtime @@ -82,11 +87,6 @@ 3.1.0 provided - - com.microsoft.azure - applicationinsights-web - 3.6.1 - org.marc4j From ca84b05fad38af0989ee04ea3eca32884cd9312b Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Thu, 26 Jun 2025 13:06:06 -0400 Subject: [PATCH 06/14] update log4j to use azure file store --- src/main/resources/log4j.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index 1a91f64..28bd762 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -10,7 +10,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS}{America/New_York # Redirect log messages to a log file, support file rolling. log4j.appender.file=org.apache.log4j.DailyRollingFileAppender -log4j.appender.file.File=/home/AlmaRSA-PSB/logs/application.log +log4j.appender.file.File=/mnt/AlmaRSA-PSB/logs/application.log log4j.appender.file.DatePattern='_'yyyy-MM-dd'.log' log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{America/New_York} %tid %-5p %15.15c{1} %3.3L: %m %n From c6d23ed092fa904c8e2d304395ff152a5cbe5bf1 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Tue, 8 Jul 2025 15:07:33 -0400 Subject: [PATCH 07/14] add github deployment --- .../workflows/azure-webapps-java-war-prod.yml | 37 +++++++++++++++++++ .../workflows/azure-webapps-java-war-psb.yml | 36 ++++++++++++++++++ src/main/resources/log4j.properties | 2 +- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/azure-webapps-java-war-prod.yml create mode 100644 .github/workflows/azure-webapps-java-war-psb.yml diff --git a/.github/workflows/azure-webapps-java-war-prod.yml b/.github/workflows/azure-webapps-java-war-prod.yml new file mode 100644 index 0000000..860af10 --- /dev/null +++ b/.github/workflows/azure-webapps-java-war-prod.yml @@ -0,0 +1,37 @@ +name: Java CI with Maven + +env: + AZURE_WEBAPP_NAME: wrlc-alma-remote-storage + JAVA_VERSION: '11' + DISTRIBUTION: 'zulu' + +on: + push: + tags: + - '*' + +jobs: + build: + + runs-on: ubuntu-latest + environment: 'Production' + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java version + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.DISTRIBUTION }} + cache: 'maven' + + - name: Build with Maven + run: mvn package + + - name: Azure WebApp + uses: Azure/webapps-deploy@v3 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PROD }} + package: '*.war' \ No newline at end of file diff --git a/.github/workflows/azure-webapps-java-war-psb.yml b/.github/workflows/azure-webapps-java-war-psb.yml new file mode 100644 index 0000000..4c45ebd --- /dev/null +++ b/.github/workflows/azure-webapps-java-war-psb.yml @@ -0,0 +1,36 @@ +name: Java CI with Maven + +env: + AZURE_WEBAPP_NAME: wrlc-alma-remote-storage + JAVA_VERSION: '11' + DISTRIBUTION: 'zulu' + +on: + push: + branches: [ "master"] + +jobs: + build: + + runs-on: ubuntu-latest + environment: 'PSB' + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java version + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.DISTRIBUTION }} + cache: 'maven' + + - name: Build with Maven + run: mvn package + + - name: Azure WebApp + uses: Azure/webapps-deploy@v3 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PSB }} + package: '*.war' \ No newline at end of file diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index 28bd762..009adc8 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -10,7 +10,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS}{America/New_York # Redirect log messages to a log file, support file rolling. log4j.appender.file=org.apache.log4j.DailyRollingFileAppender -log4j.appender.file.File=/mnt/AlmaRSA-PSB/logs/application.log +log4j.appender.file.File=/mnt/AlmaRSA/logs/application.log log4j.appender.file.DatePattern='_'yyyy-MM-dd'.log' log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}{America/New_York} %tid %-5p %15.15c{1} %3.3L: %m %n From a58fb9b5cfc67fc4fe57ecc1fd83cd25ea8199d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 19:09:47 +0000 Subject: [PATCH 08/14] Bump org.json:json from 20180813 to 20231013 Bumps [org.json:json](https://github.com/douglascrockford/JSON-java) from 20180813 to 20231013. - [Release notes](https://github.com/douglascrockford/JSON-java/releases) - [Changelog](https://github.com/stleary/JSON-java/blob/master/docs/RELEASES.md) - [Commits](https://github.com/douglascrockford/JSON-java/commits) --- updated-dependencies: - dependency-name: org.json:json dependency-version: '20231013' dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68b5093..786e816 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ org.json json - 20180813 + 20231013 From 84c2484d5bb516db9dd4fd948d68f30372d15906 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Tue, 8 Jul 2025 15:38:05 -0400 Subject: [PATCH 09/14] update workflow names --- .github/workflows/azure-webapps-java-war-prod.yml | 2 +- .github/workflows/azure-webapps-java-war-psb.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-webapps-java-war-prod.yml b/.github/workflows/azure-webapps-java-war-prod.yml index 860af10..188e148 100644 --- a/.github/workflows/azure-webapps-java-war-prod.yml +++ b/.github/workflows/azure-webapps-java-war-prod.yml @@ -1,4 +1,4 @@ -name: Java CI with Maven +name: Java CI with Maven (Production) env: AZURE_WEBAPP_NAME: wrlc-alma-remote-storage diff --git a/.github/workflows/azure-webapps-java-war-psb.yml b/.github/workflows/azure-webapps-java-war-psb.yml index 4c45ebd..acf2d4e 100644 --- a/.github/workflows/azure-webapps-java-war-psb.yml +++ b/.github/workflows/azure-webapps-java-war-psb.yml @@ -1,4 +1,4 @@ -name: Java CI with Maven +name: Java CI with Maven (PSB) env: AZURE_WEBAPP_NAME: wrlc-alma-remote-storage From 46a3faa618165d1eea502100df9056a3e512e868 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Tue, 15 Jul 2025 11:18:29 -0400 Subject: [PATCH 10/14] update app names in github actions --- .github/workflows/azure-webapps-java-war-prod.yml | 2 +- .github/workflows/azure-webapps-java-war-psb.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-webapps-java-war-prod.yml b/.github/workflows/azure-webapps-java-war-prod.yml index 188e148..023f715 100644 --- a/.github/workflows/azure-webapps-java-war-prod.yml +++ b/.github/workflows/azure-webapps-java-war-prod.yml @@ -1,7 +1,7 @@ name: Java CI with Maven (Production) env: - AZURE_WEBAPP_NAME: wrlc-alma-remote-storage + AZURE_WEBAPP_NAME: wrlc-alma-remote-storage-app JAVA_VERSION: '11' DISTRIBUTION: 'zulu' diff --git a/.github/workflows/azure-webapps-java-war-psb.yml b/.github/workflows/azure-webapps-java-war-psb.yml index acf2d4e..9d3b02f 100644 --- a/.github/workflows/azure-webapps-java-war-psb.yml +++ b/.github/workflows/azure-webapps-java-war-psb.yml @@ -1,7 +1,7 @@ name: Java CI with Maven (PSB) env: - AZURE_WEBAPP_NAME: wrlc-alma-remote-storage + AZURE_WEBAPP_NAME: wrlc-alma-remote-storage-app-psb JAVA_VERSION: '11' DISTRIBUTION: 'zulu' From 62c6655da6c84f73c097ddf05fa028bfca196091 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Fri, 18 Jul 2025 16:05:11 -0400 Subject: [PATCH 11/14] update app name in psb github action --- .github/workflows/azure-webapps-java-war-psb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-webapps-java-war-psb.yml b/.github/workflows/azure-webapps-java-war-psb.yml index 9d3b02f..0a6d1d0 100644 --- a/.github/workflows/azure-webapps-java-war-psb.yml +++ b/.github/workflows/azure-webapps-java-war-psb.yml @@ -1,7 +1,7 @@ name: Java CI with Maven (PSB) env: - AZURE_WEBAPP_NAME: wrlc-alma-remote-storage-app-psb + AZURE_WEBAPP_NAME: scf-remote-storage-app JAVA_VERSION: '11' DISTRIBUTION: 'zulu' From 04c69b2792ad4fed7560609ae4645a3e38137705 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Fri, 18 Jul 2025 16:12:59 -0400 Subject: [PATCH 12/14] change branch name on psb action --- .github/workflows/azure-webapps-java-war-psb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-webapps-java-war-psb.yml b/.github/workflows/azure-webapps-java-war-psb.yml index 0a6d1d0..60f997d 100644 --- a/.github/workflows/azure-webapps-java-war-psb.yml +++ b/.github/workflows/azure-webapps-java-war-psb.yml @@ -7,7 +7,7 @@ env: on: push: - branches: [ "master"] + branches: [ "main"] jobs: build: From 731f6c689725a63b430c214757d081cd52dadfc5 Mon Sep 17 00:00:00 2001 From: Tom Boone Date: Tue, 22 Jul 2025 10:32:17 -0400 Subject: [PATCH 13/14] update apps/environments for deployment --- .github/workflows/azure-webapps-java-war-prod.yml | 4 ++-- .github/workflows/azure-webapps-java-war-psb.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/azure-webapps-java-war-prod.yml b/.github/workflows/azure-webapps-java-war-prod.yml index 023f715..246705a 100644 --- a/.github/workflows/azure-webapps-java-war-prod.yml +++ b/.github/workflows/azure-webapps-java-war-prod.yml @@ -1,7 +1,7 @@ name: Java CI with Maven (Production) env: - AZURE_WEBAPP_NAME: wrlc-alma-remote-storage-app + AZURE_WEBAPP_NAME: scf-remote-storage-app JAVA_VERSION: '11' DISTRIBUTION: 'zulu' @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest - environment: 'Production' + environment: 'Production IZs - Stage' steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/azure-webapps-java-war-psb.yml b/.github/workflows/azure-webapps-java-war-psb.yml index 60f997d..8778ddf 100644 --- a/.github/workflows/azure-webapps-java-war-psb.yml +++ b/.github/workflows/azure-webapps-java-war-psb.yml @@ -1,7 +1,7 @@ name: Java CI with Maven (PSB) env: - AZURE_WEBAPP_NAME: scf-remote-storage-app + AZURE_WEBAPP_NAME: scf-remote-storage-app-psb-iz JAVA_VERSION: '11' DISTRIBUTION: 'zulu' @@ -13,7 +13,7 @@ jobs: build: runs-on: ubuntu-latest - environment: 'PSB' + environment: 'PSB IZs - Stage' steps: - uses: actions/checkout@v4 From 9a908447f399b1c61e9ae6de90e99fed4734fbf1 Mon Sep 17 00:00:00 2001 From: Joel Shields Date: Fri, 24 Oct 2025 09:57:13 -0400 Subject: [PATCH 14/14] Add or update the Azure App Service build and deployment workflow config --- .../main_scf-remote-storage-app(stage).yml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/main_scf-remote-storage-app(stage).yml diff --git a/.github/workflows/main_scf-remote-storage-app(stage).yml b/.github/workflows/main_scf-remote-storage-app(stage).yml new file mode 100644 index 0000000..d4abf68 --- /dev/null +++ b/.github/workflows/main_scf-remote-storage-app(stage).yml @@ -0,0 +1,63 @@ +# 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 WAR app to Azure Web App - scf-remote-storage-app + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java version + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'microsoft' + + - name: Build with Maven + run: mvn clean install + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: java-app + path: '${{ github.workspace }}/target/*.war' + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: java-app + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E30C62BC95864D02B791F844D34CABBA }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_83ABBDA0F7A3476486B300709D7A60AB }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_C34478ADAB84421D9E25B7C7B4B855A8 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'scf-remote-storage-app' + slot-name: 'stage' + package: '*.war' +