Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last set of tweaks for RMI Azure deployment #213

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
environment: dev
environment: test
permissions:
contents: 'read'
id-token: 'write'
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Test?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same next line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, it's just an unfortunate mismatch of names. I did the same for OPGEE, the rational is that we already had an rmi-{pacta,opgee}-dev for our SA environment, so the RMI deployments are named test to disambiguate them. They are also test environments in a sense, but yeah the resource group names are -DEV and -PROD

imageToDeploy: rmisppactaweupatdev.azurecr.io/pacta:test
location: centralus

- name: Deploy frontend
Expand All @@ -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 }}
4 changes: 2 additions & 2 deletions cmd/server/configs/test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

15 changes: 15 additions & 0 deletions frontend/envs/env.test
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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-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",
Expand Down
10 changes: 5 additions & 5 deletions frontend/swa-cli.config.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Loading