From 49d6c14604ebda3e6b28494e1d928732d023846d Mon Sep 17 00:00:00 2001 From: Brandon Sprague Date: Wed, 2 Oct 2024 20:25:15 -0700 Subject: [PATCH 1/2] Last set of tweaks for RMI Azure deployment - Creates/updates relevant configs (mostly frontend) - Moves our GH Actions deploy workflow to point at RMI's Azure --- .github/workflows/deploy.yml | 26 +++++++++++++------------- cmd/server/configs/test.conf | 4 ++-- frontend/envs/env.test | 15 +++++++++++++++ frontend/package.json | 2 ++ frontend/swa-cli.config.json | 10 +++++----- 5 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 frontend/envs/env.test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 525a1fe..8e408a5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,7 +6,7 @@ on: jobs: deploy: runs-on: ubuntu-latest - environment: dev + environment: test permissions: contents: 'read' id-token: 'write' @@ -27,9 +27,9 @@ jobs: - name: Azure CLI login uses: azure/login@v1 with: - client-id: ${{ secrets.DEV_AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + client-id: ${{ secrets.TEST_AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.TEST_AZURE_TENANT_ID }} + subscription-id: ${{ secrets.TEST_AZURE_SUBSCRIPTION_ID }} allow-no-subscriptions: false - name: Login to ACR via OIDC @@ -47,7 +47,7 @@ jobs: working-directory: frontend run: | npm ci - npm run build:dev + npm run build:test npm run lint npm run typecheck @@ -57,18 +57,18 @@ jobs: - name: Push docker images run: | - bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/server:push_image -- --tag=dev - bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/runner:push_image -- --tag=dev - bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/parser:push_image -- --tag=dev + bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/server:push_image -- --tag=test + bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/runner:push_image -- --tag=test + bazelisk run --@io_bazel_rules_go//go/config:pure //cmd/parser:push_image -- --tag=test - name: Deploy backend on Container Apps uses: azure/container-apps-deploy-action@v1 with: disableTelemetry: true - containerAppName: pactasrv-dev - containerAppEnvironment: pacta-dev - resourceGroup: rmi-pacta-dev - imageToDeploy: rmisa.azurecr.io/pacta:dev + containerAppName: pactasrv-test + containerAppEnvironment: pacta-test + resourceGroup: RMI-SP-PACTA-WEU-PAT-DEV + imageToDeploy: rmisppactaweupatdev.azurecr.io/pacta:test location: centralus - name: Deploy frontend @@ -81,4 +81,4 @@ jobs: output_location: '' skip_app_build: true skip_api_build: true - azure_static_web_apps_api_token: ${{ secrets.DEV_AZURE_STATIC_WEB_APPS_API_TOKEN }} + azure_static_web_apps_api_token: ${{ secrets.TEST_AZURE_STATIC_WEB_APPS_API_TOKEN }} diff --git a/cmd/server/configs/test.conf b/cmd/server/configs/test.conf index 51a6214..d5150a7 100644 --- a/cmd/server/configs/test.conf +++ b/cmd/server/configs/test.conf @@ -4,7 +4,7 @@ port 80 use_azure_runner true -azure_event_subscription 69b6db12-37e3-4e1f-b48c-aa41dba612a9 -azure_event_resource_group rmi-pacta-test +azure_event_subscription feef729b-4584-44af-a0f9-4827075512f9 +azure_event_resource_group rmi-sp-pacta-weu-pat-dev azure_event_topic pacta-events-test diff --git a/frontend/envs/env.test b/frontend/envs/env.test new file mode 100644 index 0000000..d08b11f --- /dev/null +++ b/frontend/envs/env.test @@ -0,0 +1,15 @@ +AUTH_SERVER_URL=https://auth-api.dev.rmi.siliconally.dev +API_SERVER_URL=https://pacta-api.dev.rmi.siliconally.dev + +MSAL_USER_FLOW_NAME=B2C_1_susi_dev +MSAL_USER_FLOW_AUTHORITY=https://rmiauthdev.b2clogin.com/rmiauthdev.onmicrosoft.com/B2C_1_susi_dev +MSAL_AUTHORITY_DOMAIN=rmiauthdev.b2clogin.com +MSAL_CLIENT_ID=218f47ee-11b1-459a-b914-b7fa6f107e7b +# See https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md#redirecturi-considerations +MSAL_REDIRECT_URI=https://pacta.dev.rmi.siliconally.dev/blank +MSAL_LOGOUT_URI=https://pacta.dev.rmi.siliconally.dev/ +MSAL_MIN_LOG_LEVEL=INFO + +BASE_URL=https://pacta.dev.rmi.siliconally.dev + +I18N_STRATEGY=prefix diff --git a/frontend/package.json b/frontend/package.json index 3172dee..671270f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,6 +6,8 @@ "build:local": "nuxt build --dotenv=envs/env.local", "build:dev": "NITRO_PRESET=azure nuxi build --dotenv=envs/env.dev", "deploy:dev": "npm run build:dev && swa deploy pacta-frontend-dev --no-use-keychain --app-name pacta-frontend-dev --resource-group rmi-pacta-dev --env Production", + "build:test": "NITRO_PRESET=azure nuxi build --dotenv=envs/env.test", + "deploy:test": "npm run build:test && swa deploy pacta-frontend-test --no-use-keychain --app-name pacta-frontend-test --resource-group rmi-pacta-test --env Production", "typecheck": "nuxi typecheck", "lint": "eslint --cache --ext .js,.vue,.ts ./ && stylelint --cache '**/*.{vue,css,scss}'", "lint:fix": "eslint --fix --ext .js,.vue,.ts ./ && stylelint '**/*.{vue,css,scss}' --fix", diff --git a/frontend/swa-cli.config.json b/frontend/swa-cli.config.json index 2a1a151..f34ddc2 100644 --- a/frontend/swa-cli.config.json +++ b/frontend/swa-cli.config.json @@ -1,16 +1,16 @@ { "$schema": "https://aka.ms/azure/static-web-apps-cli/schema", "configurations": { - "pacta-frontend-dev": { + "pacta-frontend-test": { "appLocation": ".", "apiLocation": ".output/server", "outputLocation": ".output/public", - "appBuildCommand": "npm run build:dev", + "appBuildCommand": "npm run build:test", "run": "npm run local", "appDevserverUrl": "http://localhost:3000", "apiDevserverUrl": "http://localhost:8081", - "appName": "pacta-frontend-dev", - "resourceGroup": "rmi-pacta-dev" + "appName": "pacta-frontend-test", + "resourceGroup": "RMI-SP-PACTA-WEU-PAT-DEV" } } -} \ No newline at end of file +} From 6fc28536c5ba8faa1bec32109eb127ef68e50a77 Mon Sep 17 00:00:00 2001 From: Brandon Sprague Date: Fri, 15 Nov 2024 12:13:58 -0800 Subject: [PATCH 2/2] Fix a few straggling references --- cmd/server/configs/test.conf | 2 +- frontend/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/server/configs/test.conf b/cmd/server/configs/test.conf index d5150a7..15f1bef 100644 --- a/cmd/server/configs/test.conf +++ b/cmd/server/configs/test.conf @@ -5,6 +5,6 @@ port 80 use_azure_runner true azure_event_subscription feef729b-4584-44af-a0f9-4827075512f9 -azure_event_resource_group rmi-sp-pacta-weu-pat-dev +azure_event_resource_group RMI-SP-PACTA-WEU-PAT-DEV azure_event_topic pacta-events-test diff --git a/frontend/package.json b/frontend/package.json index 671270f..9fafd9f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,7 @@ "build:dev": "NITRO_PRESET=azure nuxi build --dotenv=envs/env.dev", "deploy:dev": "npm run build:dev && swa deploy pacta-frontend-dev --no-use-keychain --app-name pacta-frontend-dev --resource-group rmi-pacta-dev --env Production", "build:test": "NITRO_PRESET=azure nuxi build --dotenv=envs/env.test", - "deploy:test": "npm run build:test && swa deploy pacta-frontend-test --no-use-keychain --app-name pacta-frontend-test --resource-group rmi-pacta-test --env Production", + "deploy:test": "npm run build:test && swa deploy pacta-frontend-test --no-use-keychain --app-name pacta-frontend-test --resource-group RMI-SP-PACTA-WEU-PAT-DEV --env Production", "typecheck": "nuxi typecheck", "lint": "eslint --cache --ext .js,.vue,.ts ./ && stylelint --cache '**/*.{vue,css,scss}'", "lint:fix": "eslint --fix --ext .js,.vue,.ts ./ && stylelint '**/*.{vue,css,scss}' --fix",