From 997c2b1fe7c2f9cd718aee6f8e3f7de63d919b80 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Wed, 28 Jun 2023 16:03:30 -0400 Subject: [PATCH] Add EU QA Web client information (#5704) --- .github/workflows/build-web.yml | 2 + .github/workflows/deploy-eu-qa-web.yml | 60 ++++++++++++++++++++++++++ apps/web/config/euprd.json | 2 +- apps/web/config/euqa.json | 11 +++++ apps/web/package.json | 1 + 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-eu-qa-web.yml create mode 100644 apps/web/config/euqa.json diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml index 4a7918a81b..185b3b96cb 100644 --- a/.github/workflows/build-web.yml +++ b/.github/workflows/build-web.yml @@ -84,6 +84,8 @@ jobs: npm_command: "build:bit:ee" - name: "cloud-euprd" npm_command: "build:bit:euprd" + - name: "cloud-euqa" + npm_command: "build:bit:euqa" steps: - name: Checkout repo diff --git a/.github/workflows/deploy-eu-qa-web.yml b/.github/workflows/deploy-eu-qa-web.yml new file mode 100644 index 0000000000..f4d32f7681 --- /dev/null +++ b/.github/workflows/deploy-eu-qa-web.yml @@ -0,0 +1,60 @@ +--- +name: Deploy Web to EU-QA Cloud + +on: + workflow_dispatch: + inputs: + tag: + description: "Branch name to deploy (examples: 'master', 'feature/sm')" + required: true + type: string + default: master + +jobs: + azure-deploy: + name: Deploy to Azure + runs-on: ubuntu-22.04 + env: + _WEB_ARTIFACT: "web-*-cloud-euqa.zip" + steps: + - name: Login to Azure - EU Subscription + uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.6 + with: + creds: ${{ secrets.AZURE_KV_EU_QA_SERVICE_PRINCIPAL }} + + - name: Retrieve Storage Account connection string + id: retrieve-secrets + uses: bitwarden/gh-actions/get-keyvault-secrets@37ffa14164a7308bc273829edfe75c97cd562375 + with: + keyvault: webvaulteu-westeurope-qa + secrets: "sa-bitwarden-web-vault-dev-key-temp" + + - name: Download latest cloud asset + uses: bitwarden/gh-actions/download-artifacts@37ffa14164a7308bc273829edfe75c97cd562375 + with: + workflow: build-web.yml + path: apps/web + workflow_conclusion: success + branch: ${{ github.event.inputs.tag }} + artifacts: ${{ env._WEB_ARTIFACT }} + + - name: Unzip build asset + working-directory: apps/web + run: unzip ${{ env._WEB_ARTIFACT }} + + - name: Empty container in Storage Account + run: | + az storage blob delete-batch \ + --source '$web' \ + --pattern '*' \ + --connection-string "${{ steps.retrieve-secrets.outputs.sa-bitwarden-web-vault-dev-key-temp }}" + + - name: Deploy to Azure Storage Account + working-directory: apps/web + run: | + az storage blob upload-batch \ + --source "./build" \ + --destination '$web' \ + --connection-string "${{ steps.retrieve-secrets.outputs.sa-bitwarden-web-vault-dev-key-temp }}" \ + --overwrite \ + --no-progress diff --git a/apps/web/config/euprd.json b/apps/web/config/euprd.json index 576b5b4cfa..4218593ede 100644 --- a/apps/web/config/euprd.json +++ b/apps/web/config/euprd.json @@ -1,6 +1,6 @@ { "urls": { - "icons": "https://icons.bitwarden.net", + "icons": "https://icons.bitwarden.eu", "notifications": "https://notifications.bitwarden.eu", "scim": "https://scim.bitwarden.eu" }, diff --git a/apps/web/config/euqa.json b/apps/web/config/euqa.json new file mode 100644 index 0000000000..496b52065c --- /dev/null +++ b/apps/web/config/euqa.json @@ -0,0 +1,11 @@ +{ + "urls": { + "icons": "https://icons.euqa.bitwarden.pw", + "notifications": "https://notifications.euqa.bitwarden.pw", + "scim": "https://scim.euqa.bitwarden.pw" + }, + "flags": { + "secretsManager": true, + "showPasswordless": true + } +} diff --git a/apps/web/package.json b/apps/web/package.json index 5949ea2fbb..4be9ecc941 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -11,6 +11,7 @@ "build:bit:dev:watch": "cross-env ENV=development npm run build:bit:watch", "build:bit:qa": "cross-env NODE_ENV=production ENV=qa npm run build:bit", "build:bit:euprd": "cross-env NODE_ENV=production ENV=euprd npm run build:bit", + "build:bit:euqa": "cross-env NODE_ENV=production ENV=euqa npm run build:bit", "build:bit:cloud": "cross-env NODE_ENV=production ENV=cloud npm run build:bit", "build:oss:selfhost:watch": "cross-env ENV=selfhosted npm run build:oss:watch", "build:bit:selfhost:watch": "cross-env ENV=selfhosted npm run build:bit:watch",