From 26940262a2aef2390138d9aa6662aa7aa5d66a6b Mon Sep 17 00:00:00 2001 From: Chris Trevino Date: Wed, 25 Aug 2021 12:57:10 -0700 Subject: [PATCH] update tenant client builds to use tenantized config --- .vsts-ci.yml | 12 ++++++------ package.json | 4 +--- packages/api/package.json | 2 +- packages/webapp/config/tenant-integration.json | 9 +++++++++ .../{production.json => tenant-production.json} | 0 packages/webapp/package.json | 6 ++++-- 6 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 packages/webapp/config/tenant-integration.json rename packages/webapp/config/{production.json => tenant-production.json} (100%) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 6be6baa1..4c13c7a5 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -75,7 +75,7 @@ stages: displayName: Build Schema inputs: targetType: 'inline' - script: 'yarn clean: && yarn prepare:integ' + script: 'yarn prepare:' env: CI: true @@ -83,7 +83,7 @@ stages: displayName: Deploy Static Webapp (Integ) inputs: targetType: 'inline' - script: yarn deploy:webapp + script: yarn build:webapp:integ && yarn deploy:webapp env: CI: true WEBAPP_STORAGE_ACCOUNT: $(WEBAPP_INTEG_STORAGE_ACCOUNT) @@ -93,7 +93,7 @@ stages: displayName: Deploy Tenantized Static Webapp (Integ) inputs: targetType: 'inline' - script: yarn deploy:webapp + script: yarn build:webapp:tenant_integ && yarn deploy:webapp env: CI: true WEBAPP_STORAGE_ACCOUNT: $(TENANT_WEBAPP_INTEG_STORAGE_ACCOUNT) @@ -149,7 +149,7 @@ stages: displayName: Build Schema inputs: targetType: 'inline' - script: 'yarn clean: && yarn prepare:prod' + script: 'yarn prepare:' env: CI: true @@ -157,7 +157,7 @@ stages: displayName: Deploy Static Webapp (Prod) inputs: targetType: 'inline' - script: yarn deploy:webapp + script: yarn build:webapp:prod && yarn deploy:webapp env: CI: true WEBAPP_STORAGE_ACCOUNT: $(WEBAPP_PROD_STORAGE_ACCOUNT) @@ -167,7 +167,7 @@ stages: displayName: Deploy Tenantized Static Webapp (Prod) inputs: targetType: 'inline' - script: yarn deploy:webapp + script: yarn build:webapp:tenant_prod && yarn deploy:webapp env: CI: true WEBAPP_STORAGE_ACCOUNT: $(TENANT_WEBAPP_PROD_STORAGE_ACCOUNT) diff --git a/package.json b/package.json index fb482611..ecca86b0 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,7 @@ "build:": "yarn workspaces foreach -pvt run build", "test:": "yarn workspaces foreach -pv run test", "start:": "yarn workspaces foreach -piv run start", - "prepare:common": "yarn build:schema && yarn build:api && yarn archive:api", - "prepare:integ": "yarn prepare:common && yarn build:webapp:integ", - "prepare:prod": "yarn prepare:common && yarn build:webapp:prod", + "prepare:": "yarn build:schema && yarn build:api && yarn archive:api", "bundle:": "yarn workspaces foreach -piv run bundle", "lint:": "essex lint --fix --strict", "git_is_clean": "essex git-is-clean", diff --git a/packages/api/package.json b/packages/api/package.json index eed12c83..d0027b7f 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -8,7 +8,7 @@ "start": "nodemon src/index.ts", "start:api": "yarn start", "start:local": "docker-compose up -d && nodemon src/index.ts", - "build": "run-s compile copy_assets write_deploy_package", + "build": "run-s clean compile copy_assets write_deploy_package", "build:api": "yarn build", "archive": "run-s install_deploy_deps create_deploy_archive", "archive:api": "yarn archive", diff --git a/packages/webapp/config/tenant-integration.json b/packages/webapp/config/tenant-integration.json new file mode 100644 index 00000000..03511f28 --- /dev/null +++ b/packages/webapp/config/tenant-integration.json @@ -0,0 +1,9 @@ +{ + "server": { + "devMode": false + }, + "api": { + "url": "https://greenlight-api-integ.azurewebsites.net/graphql", + "socketUrl": "wss://greenlight-api-integ.azurewebsites.net/subscriptions" + } +} diff --git a/packages/webapp/config/production.json b/packages/webapp/config/tenant-production.json similarity index 100% rename from packages/webapp/config/production.json rename to packages/webapp/config/tenant-production.json diff --git a/packages/webapp/package.json b/packages/webapp/package.json index dec96eed..abd76957 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -8,8 +8,10 @@ "start": "yarn assemble:localizations && next dev", "start:webapp": "yarn start", "build": "run-s assemble:localizations next_build next_export server_build", - "build:webapp:integ": "NODE_CONFIG_ENV=integration run-s build archive", - "build:webapp:prod": "NODE_CONFIG_ENV=production run-s build archive", + "build:webapp:integ": "NODE_CONFIG_ENV=integration run-s clean build archive", + "build:webapp:prod": "NODE_CONFIG_ENV=production run-s clean build archive", + "build:webapp:tenant_integ": "NODE_CONFIG_ENV=tenant-integration run-s build archive", + "build:webapp:tenant_prod": "NODE_CONFIG_ENV=tenant-production run-s build archive", "deploy:webapp": "essex deploy --type azure-blob-storage --storageAccount $WEBAPP_STORAGE_ACCOUNT --storageAccountKey $WEBAPP_STORAGE_KEY --verbose --paths out/", "next_build": "next build", "next_export": "next export",