From ae59d66b96dc6cb672ea260338a75c69f9b2c2d2 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 5 Oct 2022 15:26:57 -0400 Subject: [PATCH 1/6] Made 'url' property a function of applicationAbbreviation --- src/constants/application-config.js | 1 + src/constants/endpoints.js | 12 ++++++------ src/store/index.js | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index f42a2c183..0e185cff4 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -7,6 +7,7 @@ const applicationConfig = { COOKIE_PATH: "/", CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT, // "Localhost", "Dev", "QA", and "Prod" APPLICATION_NAME: "FixMyGlass", + APPLICATION_ABBREVIATION: "fmg", SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass" }; diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index d0e05919b..7545f38b0 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -1,10 +1,14 @@ const endpoints = { GetRouteInfo: { - url: "/content/api/v1/content/RouteInfo", + url: (applicationAbbreviation) => `/content/api/v1/content/${applicationAbbreviation}/RouteInfo`, method: "POST", }, GetHomepageInfo: { - url: "/content/api/v1/content/HomepageInfo", + url: (applicationAbbreviation) => `/content/api/v1/content/${applicationAbbreviation}/HomepageInfo`, + method: "GET", + }, + GetPageData: { + url: (applicationAbbreviation, pageName) => `/content/api/v1/content/${applicationAbbreviation}/${pageName}`, method: "GET", }, GetVehicleYears: { @@ -31,10 +35,6 @@ const endpoints = { url: "/parts/api/v1/parts/damage-options", method: "GET", }, - GetPageData: { - url: "/content/api/v1/content", - method: "GET", - }, LookupVehicleByYmms: { url: "/vehicle/api/v1/vehicle/Lookup", method: "GET", diff --git a/src/store/index.js b/src/store/index.js index 95dd63ef7..233a57d37 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -538,7 +538,7 @@ export const actions = { getRouteInfo(context, { pageName }) { return globalMethods.callHttpClient({ method: endpoints.GetRouteInfo.method, - endpoint: endpoints.GetRouteInfo.url, + endpoint: endpoints.GetRouteInfo.url(applicationConfig.APPLICATION_ABBREVIATION), payload: { pageName: pageName, }, @@ -547,13 +547,13 @@ export const actions = { getHomepageName(context) { return globalMethods.callHttpClient({ method: endpoints.GetHomepageInfo.method, - endpoint: endpoints.GetHomepageInfo.url, + endpoint: endpoints.GetHomepageInfo.url(applicationConfig.APPLICATION_ABBREVIATION), }); }, getPageData(context, { pageName }) { return globalMethods.callHttpClient({ method: endpoints.GetPageData.method, - endpoint: `${endpoints.GetPageData.url}/${pageName}`, + endpoint: endpoints.GetPageData.url(applicationConfig.APPLICATION_ABBREVIATION, pageName), payload: {}, }); }, From 2715f524e900ecb74a8aff576d838d1482378beb Mon Sep 17 00:00:00 2001 From: FrankRua Date: Tue, 25 Oct 2022 14:21:42 -0400 Subject: [PATCH 2/6] Deploy to both buckets --- azure-pipelines.yml | 283 ++++++++++++++++++++++---------------------- 1 file changed, 144 insertions(+), 139 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 207c013be..5d37f238c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ trigger: branches: - include: [ develop, release/* ] + include: [develop, release/*] paths: exclude: - deployment/* @@ -8,7 +8,7 @@ trigger: - "*" pr: branches: - include: [ '*' ] + include: ["*"] paths: exclude: - deployment/* @@ -35,144 +35,149 @@ variables: stages: # PR's - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - stage: TestPr - displayName: Run Unit Tests For PullRequest - jobs: - - template: templates/digital/vue-jest-run-unit-tests.yml@AzureDevOps - parameters: - nodeContainer: node - npmLocation: $(Build.SourcesDirectory) - testResultsFile: junit.xml - summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml + - stage: TestPr + displayName: Run Unit Tests For PullRequest + jobs: + - template: templates/digital/vue-jest-run-unit-tests.yml@AzureDevOps + parameters: + nodeContainer: node + npmLocation: $(Build.SourcesDirectory) + testResultsFile: junit.xml + summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml + - # Dev Build/Deploy - ${{ else }}: - - stage: Dev - condition: eq(variables['Build.SourceBranch'], variables['dev-branch'] ) - variables: - - group: FixMyGlassDev - jobs: - - deployment: devBuildDeployment - displayName: Build and Deploy FMG - Dev - environment: digitalCloud-dev - container: node - workspace: - clean: all - strategy: - runOnce: - deploy: - steps: - - checkout: self - clean: true - - template: templates/digital/step-build-vue.yml@AzureDevOps - parameters: - buildOutputDir: dist - environment: Dev - - template: templates/digital/step-deploy-vue.yml@AzureDevOps - parameters: - artifactName: vueDistDev - awsProfile: $(devDeploymentProfile) - outputPath: /fmg/ - deployBuckets: - safelite-dev-fmg-us-east-1: - clearFolder: true - deployFolder: '' - region: us-east-1 - appDeployVariables: - __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) - __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) - __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) - __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) - indexDeployVariables: - __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) - __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) - cfDistributionId: $(cfDistributionId) + # Dev Build/Deploy + - stage: Dev + condition: eq(variables['Build.SourceBranch'], variables['dev-branch'] ) + variables: + - group: FixMyGlassDev + jobs: + - deployment: devBuildDeployment + displayName: Build and Deploy FMG - Dev + environment: digitalCloud-dev + container: node + workspace: + clean: all + strategy: + runOnce: + deploy: + steps: + - checkout: self + clean: true + - template: templates/digital/step-build-vue.yml@AzureDevOps + parameters: + buildOutputDir: dist + environment: Dev + - template: templates/digital/step-deploy-vue.yml@AzureDevOps + parameters: + artifactName: vueDistDev + awsProfile: $(devDeploymentProfile) + outputPath: /fmg/ + deployBuckets: + safelite-dev-fmg-us-east-1: + clearFolder: true + deployFolder: "" + region: us-east-1 + safelite-dev-fmg-us-east-2: + clearFolder: true + deployFolder: "" + region: us-east-2 + appDeployVariables: + __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) + __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) + __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) + __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) + indexDeployVariables: + __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) + __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) + cfDistributionId: $(cfDistributionId) + # QA Build/Deploy + - stage: Qa + condition: eq(variables['Build.SourceBranch'], variables['qa-branch'] ) + variables: + - group: FixMyGlassQa + jobs: + - deployment: qaBuildDeployment + displayName: Build and Deploy FMG - QA + environment: NoApproval-All + container: node + workspace: + clean: all + strategy: + runOnce: + deploy: + steps: + - checkout: self + clean: true + - template: templates/digital/step-build-vue.yml@AzureDevOps + parameters: + buildOutputDir: dist + environment: Qa + - template: templates/digital/step-deploy-vue.yml@AzureDevOps + parameters: + artifactName: vueDistQa + awsProfile: $(qaDeploymentProfile) + outputPath: /fmg/ + deployBuckets: + safelite-qa-fmg-us-east-1: + clearFolder: true + deployFolder: "" + region: us-east-1 + appDeployVariables: + __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) + __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) + __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) + __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) + indexDeployVariables: + __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) + __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) + cfDistributionId: $(cfDistributionId) - # QA Build/Deploy - - stage: Qa - condition: eq(variables['Build.SourceBranch'], variables['qa-branch'] ) - variables: - - group: FixMyGlassQa - jobs: - - deployment: qaBuildDeployment - displayName: Build and Deploy FMG - QA - environment: NoApproval-All - container: node - workspace: - clean: all - strategy: - runOnce: - deploy: - steps: - - checkout: self - clean: true - - template: templates/digital/step-build-vue.yml@AzureDevOps - parameters: - buildOutputDir: dist - environment: Qa - - template: templates/digital/step-deploy-vue.yml@AzureDevOps - parameters: - artifactName: vueDistQa - awsProfile: $(qaDeploymentProfile) - outputPath: /fmg/ - deployBuckets: - safelite-qa-fmg-us-east-1: - clearFolder: true - deployFolder: '' - region: us-east-1 - appDeployVariables: - __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) - __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) - __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) - __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) - indexDeployVariables: - __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) - __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) - cfDistributionId: $(cfDistributionId) - - # Prod Build/Deploy - - stage: Prod - condition: succeeded('Qa') - variables: - - group: FixMyGlassProd - jobs: - - deployment: prodBuildDeployment - displayName: Build and Deploy FMG - Prod - environment: digitalCloud-prod - container: node - workspace: - clean: all - strategy: - runOnce: - deploy: - steps: - - checkout: self - clean: true - - template: templates/digital/step-build-vue.yml@AzureDevOps - parameters: - buildOutputDir: dist - environment: Prod - - template: templates/digital/step-deploy-vue.yml@AzureDevOps - parameters: - artifactName: vueDistProd - awsProfile: $(prodDeploymentProfile) - outputPath: /fmg/ - deployBuckets: - safelite-prod-fmg-us-east-1: - clearFolder: true - deployFolder: '' - region: us-east-1 - appDeployVariables: - __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) - __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) - __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) - __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) - indexDeployVariables: - __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) - __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) - cfDistributionId: $(cfDistributionId) - - template: templates/digital/auto-tag.yml@AzureDevOps - parameters: - userName: SafeliteAzureDevops - userEmail: githubazuredevops@safelite.com \ No newline at end of file + # Prod Build/Deploy + - stage: Prod + condition: succeeded('Qa') + variables: + - group: FixMyGlassProd + jobs: + - deployment: prodBuildDeployment + displayName: Build and Deploy FMG - Prod + environment: digitalCloud-prod + container: node + workspace: + clean: all + strategy: + runOnce: + deploy: + steps: + - checkout: self + clean: true + - template: templates/digital/step-build-vue.yml@AzureDevOps + parameters: + buildOutputDir: dist + environment: Prod + - template: templates/digital/step-deploy-vue.yml@AzureDevOps + parameters: + artifactName: vueDistProd + awsProfile: $(prodDeploymentProfile) + outputPath: /fmg/ + deployBuckets: + safelite-prod-fmg-us-east-1: + clearFolder: true + deployFolder: "" + region: us-east-1 + appDeployVariables: + __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) + __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) + __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) + __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) + indexDeployVariables: + __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) + __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) + cfDistributionId: $(cfDistributionId) + - template: templates/digital/auto-tag.yml@AzureDevOps + parameters: + dependsOn: prodBuildDeployment + userName: SafeliteAzureDevops + userEmail: githubazuredevops@safelite.com From 0bc01b92e52f37a1406c305641a5ffdd2bc6a922 Mon Sep 17 00:00:00 2001 From: FrankRua Date: Thu, 20 Oct 2022 10:35:52 -0400 Subject: [PATCH 3/6] Test branch --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5d37f238c..989217f02 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -49,7 +49,7 @@ stages: - ${{ else }}: # Dev Build/Deploy - stage: Dev - condition: eq(variables['Build.SourceBranch'], variables['dev-branch'] ) + condition: eq(variables['Build.SourceBranch'], variables['test-branch'] ) variables: - group: FixMyGlassDev jobs: From 1ff0fe323b20855596442de4ac79bc8f74dbd302 Mon Sep 17 00:00:00 2001 From: FrankRua Date: Thu, 20 Oct 2022 10:43:31 -0400 Subject: [PATCH 4/6] switch back to dev branch --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 989217f02..5d37f238c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -49,7 +49,7 @@ stages: - ${{ else }}: # Dev Build/Deploy - stage: Dev - condition: eq(variables['Build.SourceBranch'], variables['test-branch'] ) + condition: eq(variables['Build.SourceBranch'], variables['dev-branch'] ) variables: - group: FixMyGlassDev jobs: From 72ae029c20349960fd8f90692a1ef377b098fb3d Mon Sep 17 00:00:00 2001 From: FrankRua Date: Tue, 25 Oct 2022 13:32:06 -0400 Subject: [PATCH 5/6] multi-region support --- azure-pipelines.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5d37f238c..002f5192e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -125,6 +125,10 @@ stages: clearFolder: true deployFolder: "" region: us-east-1 + safelite-qa-fmg-us-east-2: + clearFolder: true + deployFolder: "" + region: us-east-2 appDeployVariables: __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) @@ -167,6 +171,10 @@ stages: clearFolder: true deployFolder: "" region: us-east-1 + safelite-prod-fmg-us-east-2: + clearFolder: true + deployFolder: "" + region: us-east-2 appDeployVariables: __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) From 6f4b961313cc55c5ae5cbdbc46f8d47a4a1185a8 Mon Sep 17 00:00:00 2001 From: FrankRua Date: Tue, 25 Oct 2022 14:24:34 -0400 Subject: [PATCH 6/6] config change --- azure-pipelines.yml | 2 +- vue.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 002f5192e..c06ae5c43 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,7 +26,7 @@ resources: type: github name: Safelite/AzureDevOps endpoint: Safelite - ref: refs/tags/t5.5.19 + ref: refs/tags/t5.5.31 variables: - group: Digital-Infrastructure diff --git a/vue.config.js b/vue.config.js index 6ddcd54de..64c83dd9e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,5 @@ process.env.VUE_APP_CONSUMER_CF_DISTRO = - "https://consumerapidev.safelite.com"; + "https://digitalapi.dev.safelite.io"; process.env.VUE_APP_HERITAGE_FUNNEL = "http://localhost:38000/default.aspx"; process.env.VUE_APP_GOOGLE_PLACES_API_KEY =