Skip to content

Commit

Permalink
DOP-4306 removed references to legacy environments
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed Feb 5, 2024
1 parent b282f79 commit 6c6b130
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 60 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy-prd-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
npm ci
sls deploy --stage prd
sls deploy --stage dotcomprd
sls deploy --stage legacydotcomprd
- uses: mr-smithers-excellent/docker-build-push@v5
name: build and push to ECR
with:
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/deploy-stg-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
npm ci
sls deploy --stage stg
sls deploy --stage dotcomstg
sls deploy --stage legacydotcomstg
- uses: mr-smithers-excellent/docker-build-push@v5
name: build and push to ECR
with:
Expand All @@ -59,30 +58,15 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
NPM_BASE_64_AUTH: ${{ secrets.NPM_BASE64_AUTH }}
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
- uses: mr-smithers-excellent/docker-build-push@v5
name: build and push to ECR Legacy DOTCOM
with:
image: docs-worker-pool-legacydotcomstg
tags: latest
registry: ${{ steps.login-ecr.outputs.registry }}
dockerfile: Dockerfile.legacy
buildArgs: NPM_EMAIL=${{ secrets.NPM_EMAIL }},NPM_BASE_64_AUTH=${{ secrets.NPM_BASE64_AUTH }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
NPM_BASE_64_AUTH: ${{ secrets.NPM_BASE64_AUTH }}
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
- name: Deploy ECS
run: |
cd infrastructure/ecs-main
npm ci
sls deploy --stage stg
sls deploy --stage dotcomstg
sls deploy --stage legacydotcomstg
- name: Deploy Lambdas
run: |
npm ci
sls deploy --stage stg
sls deploy --stage dotcomstg
sls deploy --stage legacydotcomstg
sls prune -n 5
6 changes: 2 additions & 4 deletions cdk-infra/utils/env.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Construct } from 'constructs';
import { getCurrentBranch } from './git';

const snootyEnvs = ['staging', 'production', 'dotcomstg', 'dotcomprd', 'legacydotcomprd', 'legacydotcomstg'] as const;
const autoBuilderEnvs = ['stg', 'prd', 'dev', 'dotcomstg', 'dotcomprd', 'legacydotcomstg', 'legacydotcomprd'] as const;
const snootyEnvs = ['staging', 'production', 'dotcomstg', 'dotcomprd'] as const;
const autoBuilderEnvs = ['stg', 'prd', 'dev', 'dotcomstg', 'dotcomprd'] as const;
const autoBuilderContextVariables = [
'enhanced',
'isFeatureBranch',
Expand All @@ -24,8 +24,6 @@ const autoBuilderToSnootyEnvMap: Record<AutoBuilderEnv, SnootyEnv> = {
prd: 'production',
dotcomprd: 'dotcomprd',
dotcomstg: 'dotcomstg',
legacydotcomstg: 'legacydotcomstg',
legacydotcomprd: 'legacydotcomprd',
};

export function envShortToFullName(env: string): SnootyEnv {
Expand Down
2 changes: 0 additions & 2 deletions cdk-infra/utils/search-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ export function getSearchIndexFolder(env: AutoBuilderEnv): string {
return '';
case 'stg':
case 'dotcomstg':
case 'legacydotcomstg':
return 'preprd';
case 'dotcomprd':
case 'legacydotcomprd':
case 'prd':
return 'prd';
}
Expand Down
2 changes: 0 additions & 2 deletions cdk-infra/utils/slack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const dashboardUrls: Record<AutoBuilderEnv, string> = {
prd: `https://workerpool-boxgs.mongodbstitch.com/pages/job.html?collName=`,
dotcomstg: `https://workerpoolstaging-qgeyp.mongodbstitch.com/pages/job.html?collName=`,
dotcomprd: `https://workerpool-boxgs.mongodbstitch.com/pages/job.html?collName=`,
legacydotcomstg: `https://workerpoolstaging-qgeyp.mongodbstitch.com/pages/job.html?collName=`,
legacydotcomprd: `https://workerpool-boxgs.mongodbstitch.com/pages/job.html?collName=`,
dev: `https://workerpoolstaging-qgeyp.mongodbstitch.com/pages/job.html?collName=`,
};

Expand Down
4 changes: 0 additions & 4 deletions cdk-infra/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@ const hostUrlMap: Record<AutoBuilderEnv, string> = {
dev: 'docs-dev.mongodb.com',
stg: 'mongodbcom-cdn.website.staging.corp.mongodb.com',
dotcomstg: 'mongodbcom-cdn.website.staging.corp.mongodb.com',
legacydotcomstg: 'mongodbcom-cdn.website.staging.corp.mongodb.com',
prd: 'www.mongodb.com',
dotcomprd: 'www.mongodb.com',
legacydotcomprd: 'www.mongodb.com',
};

const urlPrefixMap: Record<AutoBuilderEnv, string> = {
dev: 'docs',
stg: 'docs-qa',
dotcomstg: 'docs-qa',
legacydotcomstg: 'docs-qa',
prd: 'docs',
dotcomprd: 'docs',
legacydotcomprd: 'docs',
};

export const getHostUrl = (env: AutoBuilderEnv): string => hostUrlMap[env];
Expand Down
22 changes: 0 additions & 22 deletions infrastructure/ecs-main/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,18 @@ custom:
prd: '4'
dotcomstg: '4'
dotcomprd: '4'
legacydotcomstg: '4'
legacydotcomprd: '4'
minimumHealthyPercent:
dev: 100
stg: 100
prd: 100
dotcomstg: 100
dotcomprd: 100
legacydotcomstg: 100
legacydotcomprd: 100
maximumPercent:
dev: 200
stg: 200
prd: 200
dotcomstg: 200
dotcomprd: 200
legacydotcomstg: 200
legacydotcomprd: 200
deregistrationDelaySecs: '10'
targetGroupName: docs-worker-pool
accountId:
Expand All @@ -91,8 +85,6 @@ custom:
prd: 216656347858
dotcomstg: 216656347858
dotcomprd: 216656347858
legacydotcomstg: 216656347858
legacydotcomprd: 216656347858

dbUsername: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/username}
dbPassword: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/password}
Expand Down Expand Up @@ -152,25 +144,19 @@ custom:
prd: https://cdnvalidator.devops.prod.corp.mongodb.com/api/v1beta1/distributions/${self:custom.distributionName.${self:provider.stage}}/invalidations
dotcomstg: https://cdnvalidator.devops.staging.corp.mongodb.com/api/v1beta1/distributions/${self:custom.distributionName.${self:provider.stage}}/invalidations
dotcomprd: https://cdnvalidator.devops.prod.corp.mongodb.com/api/v1beta1/distributions/${self:custom.distributionName.${self:provider.stage}}/invalidations
legacydotcomstg: https://cdnvalidator.devops.staging.corp.mongodb.com/api/v1beta1/distributions/${self:custom.distributionName.${self:provider.stage}}/invalidations
legacydotcomprd: https://cdnvalidator.devops.prod.corp.mongodb.com/api/v1beta1/distributions/${self:custom.distributionName.${self:provider.stage}}/invalidations
dev: https://cdnvalidator.devops.staging.corp.mongodb.com/api/v1beta1/distributions/${self:custom.distributionName.${self:provider.stage}}/invalidations
distributionName:
stg: mongodbcom-staging-docs
dotcomstg: mongodbcom-staging-docs
legacydotcomstg: mongodbcom-staging-docs
dev: mongodbcom-staging-docs
dotcomprd: mongodbcom-prod-docs
legacydotcomprd: mongodbcom-prod-docs
prd: mongodbcom-prod-docs
env:
stg: "staging"
prd: "production"
dev: "staging"
dotcomstg: "dotcomstg"
dotcomprd: "dotcomprd"
legacydotcomstg: "dotcomstg"
legacydotcomprd: "dotcomprd"
# TODO: When satisfied with manifest generation, remove '-test'
searchIndexBucket: docs-search-indexes-test
# TODO: In future, use duplicate mapping of dotcomstg -> preprd to have
Expand All @@ -181,30 +167,22 @@ custom:
prd: "prd"
dotcomstg: "preprd"
dotcomprd: "prd"
legacydotcomstg: "preprd"
legacydotcomprd: "prd"
site:
host:
dev: "docs-dev.mongodb.com"
stg: "mongodbcom-cdn.website.staging.corp.mongodb.com"
dotcomstg: "mongodbcom-cdn.website.staging.corp.mongodb.com"
legacydotcomstg: "mongodbcom-cdn.website.staging.corp.mongodb.com"
prd: "www.mongodb.com"
dotcomprd: "www.mongodb.com"
legacydotcomprd: "www.mongodb.com"
prefix:
dev: "docs"
stg: "docs-qa"
dotcomstg: "docs-qa"
legacydotcomstg: "docs-qa"
prd: "docs"
dotcomprd: "docs"
legacydotcomprd: "docs"
errorDoc:
dotcomstg: "docs-qa/404/index.html"
dotcomprd: "docs/404/index.html"
legacydotcomstg: "docs-qa/404/index.html"
legacydotcomprd: "docs/404/index.html"

resources:
- ${file(./buckets.yml)}
Expand Down
8 changes: 0 additions & 8 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,11 @@ custom:
prd: worker-pool-deployment
dotcomstg: worker-pool-deployment
dotcomprd: worker-pool-deployment
legacydotcomstg: worker-pool-deployment
legacydotcomprd: worker-pool-deployment
searchIndexBucket:
dev: "" # I'm just here so I don't get fined
# TODO: When satisfied with manifest generation, remove the '-test'
dotcomstg: docs-search-indexes-test/preprd
dotcomprd: docs-search-indexes-test/prd
legacydotcomstg: docs-search-indexes-test/preprd
legacydotcomprd: docs-search-indexes-test/prd
fastlyDochubToken: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/dochub/token}
fastlyDochubServiceId: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/docs/dochub/service_id}
fastlyDochubMap: ${ssm:/env/${self:provider.stage}/docs/worker_pool/fastly/dochub_map}
Expand All @@ -51,8 +47,6 @@ custom:
dev: aws.partner/mongodb.com/stitch.trigger/5e00b7afec293c6507679c4d
dotcomstg: aws.partner/mongodb.com/stitch.trigger/5e00b7afec293c6507679c4d
dotcomprd: aws.partner/mongodb.com/stitch.trigger/5e00b7afec293c6507679c4d
legacydotcomstg: aws.partner/mongodb.com/stitch.trigger/5e00b7afec293c6507679c4d
legacydotcomprd: aws.partner/mongodb.com/stitch.trigger/5e00b7afec293c6507679c4d
dochubEventBus: arn:aws:events:${aws:region}:${aws:accountId}:event-bus/${self:custom.docuhubEventSource.${self:provider.stage}}
dbUsername: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/username}
dbPassword: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/password}
Expand All @@ -79,8 +73,6 @@ custom:
prd: https://workerpool-boxgs.mongodbstitch.com/pages/job.html?collName=${self:custom.jobCollection}&jobId=
dotcomstg: https://workerpoolstaging-qgeyp.mongodbstitch.com/pages/job.html?collName=${self:custom.jobCollection}&jobId=
dotcomprd: https://workerpool-boxgs.mongodbstitch.com/pages/job.html?collName=${self:custom.jobCollection}&jobId=
legacydotcomstg: https://workerpoolstaging-qgeyp.mongodbstitch.com/pages/job.html?collName=${self:custom.jobCollection}&jobId=
legacydotcomprd: https://workerpool-boxgs.mongodbstitch.com/pages/job.html?collName=${self:custom.jobCollection}&jobId=
dev: https://workerpoolstaging-qgeyp.mongodbstitch.com/pages/job.html?collName=${self:custom.jobCollection}&jobId=
env:
stg: "staging"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/job/productionJobHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe('ProductionJobHandler Tests', () => {
});

test('Execute Next Gen Build successfully', async () => {
jobHandlerTestHelper.ess(false, {
jobHandlerTestHelper.setStageForDeploySuccess(false, {
status: 'success',
output: 'Great work',
error: null,
Expand Down

0 comments on commit 6c6b130

Please sign in to comment.