From 53e4127ab8c24b4a88ca80abb9666ee33059ac19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ch=C4=99ci=C5=84ski?= Date: Thu, 21 Dec 2023 17:10:31 +0100 Subject: [PATCH] [DEVOPS-1501] Build and Deploy Web Vault for USDEV (DevTest) (#7309) * Add usdev config * add command to build usdev to package * Add usdev to build * Add usdev to web deploy workflow * Fix * Fix * Fix --- .github/workflows/build-web.yml | 2 ++ .github/workflows/deploy-web.yml | 13 ++++++++++--- apps/web/config/usdev.json | 11 +++++++++++ apps/web/package.json | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 apps/web/config/usdev.json diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml index 154e2574f4..7fc9a9f7a6 100644 --- a/.github/workflows/build-web.yml +++ b/.github/workflows/build-web.yml @@ -97,6 +97,8 @@ jobs: npm_command: "build:bit:euprd" - name: "cloud-euqa" npm_command: "build:bit:euqa" + - name: "cloud-usdev" + npm_command: "build:bit:usdev" steps: - name: Checkout repo diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml index 7e660e3658..b827014e43 100644 --- a/.github/workflows/deploy-web.yml +++ b/.github/workflows/deploy-web.yml @@ -14,6 +14,7 @@ on: - EUQA - USPROD - EUPROD + - USDEV branch-or-tag: description: "Branch or Tag name to deploy (examples: 'main', 'feature/sm', 'web-v2023.12.0')" type: string @@ -80,6 +81,13 @@ jobs: echo "environment-name=Web Vault - EU Production Cloud" >> $GITHUB_OUTPUT echo "environment-url=http://vault.bitwarden.eu" >> $GITHUB_OUTPUT ;; + "USDEV") + echo "azure-login-creds=AZURE_KV_US_DEV_SERVICE_PRINCIPAL" >> $GITHUB_OUTPUT + echo "retrieve-secrets-keyvault=webvault-eastus-dev" >> $GITHUB_OUTPUT + echo "environment-artifact=web-*-cloud-usdev.zip" >> $GITHUB_OUTPUT + echo "environment-name=Web Vault - US Development Cloud" >> $GITHUB_OUTPUT + echo "environment-url=http://vault.$ENV_NAME_LOWER.bitwarden.pw" >> $GITHUB_OUTPUT + ;; esac approval: @@ -97,7 +105,7 @@ jobs: - approval - setup runs-on: ubuntu-22.04 - if: always() + if: ${{ always() && contains( inputs.environment , 'QA' ) }} outputs: channel_id: ${{ steps.slack-message.outputs.channel_id }} ts: ${{ steps.slack-message.outputs.ts }} @@ -162,7 +170,6 @@ jobs: - setup - artifact-check - approval - - notify-start runs-on: ubuntu-22.04 env: _ENVIRONMENT: ${{ needs.setup.outputs.environment }} @@ -244,7 +251,7 @@ jobs: notify: name: Notify Slack with result runs-on: ubuntu-22.04 - if: always() + if: ${{ always() && contains( inputs.environment , 'QA' ) }} needs: - notify-start - azure-deploy diff --git a/apps/web/config/usdev.json b/apps/web/config/usdev.json new file mode 100644 index 0000000000..9b794d896d --- /dev/null +++ b/apps/web/config/usdev.json @@ -0,0 +1,11 @@ +{ + "urls": { + "icons": "https://icons.usdev.bitwarden.pw", + "notifications": "https://notifications.usdev.bitwarden.pw", + "scim": "https://scim.usdev.bitwarden.pw" + }, + "flags": { + "secretsManager": true, + "showPasswordless": true + } +} diff --git a/apps/web/package.json b/apps/web/package.json index f0d271c291..3695fdfeb1 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -12,6 +12,7 @@ "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:usdev": "cross-env NODE_ENV=production ENV=usdev 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",