skuba 10.0.0-node-22-20250115223210 → 10.0.0-node-22-20250213035014

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/lib/cli/init/prompts.d.ts +1 -1
  2. package/lib/cli/lint/internalLints/upgrade/patches/10.0.0/index.js +1 -1
  3. package/lib/cli/lint/internalLints/upgrade/patches/10.0.0/index.js.map +1 -1
  4. package/lib/cli/migrate/nodeVersion/getNode22TypesVersion.d.ts +6 -1
  5. package/lib/cli/migrate/nodeVersion/getNode22TypesVersion.js +22 -4
  6. package/lib/cli/migrate/nodeVersion/getNode22TypesVersion.js.map +2 -2
  7. package/lib/cli/migrate/nodeVersion/index.d.ts +0 -6
  8. package/lib/cli/migrate/nodeVersion/index.js +28 -35
  9. package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
  10. package/lib/cli/migrate/nodeVersion/packageJsonChecks.d.ts +2 -2
  11. package/lib/cli/migrate/nodeVersion/packageJsonChecks.js +19 -14
  12. package/lib/cli/migrate/nodeVersion/packageJsonChecks.js.map +2 -2
  13. package/lib/index.js +3 -3
  14. package/lib/utils/template.d.ts +2 -2
  15. package/lib/utils/template.js +0 -5
  16. package/lib/utils/template.js.map +2 -2
  17. package/package.json +14 -14
  18. package/template/base/tsconfig.json +2 -2
  19. package/template/express-rest-api/.buildkite/pipeline.yml +4 -4
  20. package/template/express-rest-api/.gantry/common.yml +1 -2
  21. package/template/express-rest-api/.nvmrc +1 -1
  22. package/template/express-rest-api/Dockerfile +1 -1
  23. package/template/express-rest-api/Dockerfile.dev-deps +2 -2
  24. package/template/express-rest-api/package.json +4 -4
  25. package/template/greeter/.buildkite/pipeline.yml +1 -1
  26. package/template/greeter/.nvmrc +1 -1
  27. package/template/greeter/Dockerfile +2 -2
  28. package/template/greeter/README.md +1 -1
  29. package/template/greeter/package.json +4 -4
  30. package/template/koa-rest-api/.buildkite/pipeline.yml +4 -4
  31. package/template/koa-rest-api/.gantry/common.yml +1 -2
  32. package/template/koa-rest-api/.nvmrc +1 -1
  33. package/template/koa-rest-api/Dockerfile +1 -1
  34. package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
  35. package/template/koa-rest-api/package.json +3 -3
  36. package/template/koa-rest-api/tsconfig.json +2 -2
  37. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  38. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
  39. package/template/lambda-sqs-worker-cdk/Dockerfile +3 -3
  40. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +2 -2
  41. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +2 -2
  42. package/template/lambda-sqs-worker-cdk/infra/config.ts +1 -1
  43. package/template/lambda-sqs-worker-cdk/infra/index.ts +3 -5
  44. package/template/lambda-sqs-worker-cdk/package.json +4 -4
  45. package/template/lambda-sqs-worker-cdk/tsconfig.json +2 -2
  46. package/template/oss-npm-package/.github/workflows/release.yml +1 -1
  47. package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
  48. package/template/oss-npm-package/.nvmrc +1 -1
  49. package/template/oss-npm-package/_package.json +1 -1
  50. package/template/private-npm-package/.nvmrc +1 -1
  51. package/template/private-npm-package/_package.json +2 -2
  52. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +0 -108
  53. package/template/lambda-sqs-worker/.env +0 -1
  54. package/template/lambda-sqs-worker/.nvmrc +0 -1
  55. package/template/lambda-sqs-worker/Dockerfile +0 -17
  56. package/template/lambda-sqs-worker/README.md +0 -132
  57. package/template/lambda-sqs-worker/_.npmrc +0 -13
  58. package/template/lambda-sqs-worker/docker-compose.yml +0 -10
  59. package/template/lambda-sqs-worker/package.json +0 -45
  60. package/template/lambda-sqs-worker/serverless.yml +0 -213
  61. package/template/lambda-sqs-worker/skuba.template.js +0 -33
  62. package/template/lambda-sqs-worker/src/app.test.ts +0 -116
  63. package/template/lambda-sqs-worker/src/app.ts +0 -57
  64. package/template/lambda-sqs-worker/src/config.ts +0 -62
  65. package/template/lambda-sqs-worker/src/framework/handler.test.ts +0 -61
  66. package/template/lambda-sqs-worker/src/framework/handler.ts +0 -43
  67. package/template/lambda-sqs-worker/src/framework/logging.ts +0 -27
  68. package/template/lambda-sqs-worker/src/framework/metrics.ts +0 -14
  69. package/template/lambda-sqs-worker/src/framework/validation.test.ts +0 -84
  70. package/template/lambda-sqs-worker/src/framework/validation.ts +0 -10
  71. package/template/lambda-sqs-worker/src/hooks.ts +0 -95
  72. package/template/lambda-sqs-worker/src/mapping/jobScorer.ts +0 -22
  73. package/template/lambda-sqs-worker/src/services/aws.ts +0 -5
  74. package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +0 -44
  75. package/template/lambda-sqs-worker/src/services/jobScorer.ts +0 -59
  76. package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +0 -40
  77. package/template/lambda-sqs-worker/src/services/pipelineEventSender.ts +0 -33
  78. package/template/lambda-sqs-worker/src/testing/handler.ts +0 -13
  79. package/template/lambda-sqs-worker/src/testing/logging.ts +0 -19
  80. package/template/lambda-sqs-worker/src/testing/services.ts +0 -28
  81. package/template/lambda-sqs-worker/src/testing/types.ts +0 -33
  82. package/template/lambda-sqs-worker/src/types/jobScorer.ts +0 -15
  83. package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +0 -21
  84. package/template/lambda-sqs-worker/tsconfig.json +0 -13
@@ -1,6 +1,6 @@
1
- # syntax=docker/dockerfile:1.12
1
+ # syntax=docker/dockerfile:1.13
2
2
 
3
- FROM public.ecr.aws/docker/library/node:20-alpine AS dev-deps
3
+ FROM public.ecr.aws/docker/library/node:22-alpine AS dev-deps
4
4
 
5
5
  RUN --mount=type=bind,source=package.json,target=package.json \
6
6
  corepack enable pnpm && corepack install
@@ -14,22 +14,22 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@seek/logger": "^9.0.0",
17
- "express": "^4.17.1",
17
+ "express": "^5.0.0",
18
18
  "hot-shots": "^10.0.0",
19
19
  "seek-datadog-custom-metrics": "^4.6.3",
20
20
  "skuba-dive": "^2.0.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/express": "^5.0.0",
24
- "@types/node": "^20.16.5",
24
+ "@types/node": "^22.13.1",
25
25
  "@types/supertest": "^6.0.0",
26
26
  "mime": "^4.0.1",
27
27
  "pino-pretty": "^13.0.0",
28
28
  "skuba": "*",
29
29
  "supertest": "^7.0.0"
30
30
  },
31
- "packageManager": "pnpm@9.15.3",
31
+ "packageManager": "pnpm@9.15.4",
32
32
  "engines": {
33
- "node": ">=20"
33
+ "node": ">=22"
34
34
  }
35
35
  }
@@ -38,7 +38,7 @@ steps:
38
38
  - *aws-sm
39
39
  - *private-npm
40
40
  - *docker-ecr-cache
41
- - docker-compose#v5.5.0:
41
+ - docker-compose#v5.6.0:
42
42
  run: app
43
43
  environment:
44
44
  - GITHUB_API_TOKEN
@@ -1 +1 @@
1
- 20
1
+ 22
@@ -1,6 +1,6 @@
1
- # syntax=docker/dockerfile:1.12
1
+ # syntax=docker/dockerfile:1.13
2
2
 
3
- FROM public.ecr.aws/docker/library/node:20-alpine AS dev-deps
3
+ FROM public.ecr.aws/docker/library/node:22-alpine AS dev-deps
4
4
 
5
5
  RUN --mount=type=bind,source=package.json,target=package.json \
6
6
  corepack enable pnpm && corepack install
@@ -69,7 +69,7 @@ It does not assume a deployment method or environment.
69
69
  For inspiration in this space, check out:
70
70
 
71
71
  - The `koa-rest-api` template for containerised deployments
72
- - The `lambda-sqs-worker` template for Lambda deployments
72
+ - The `lambda-sqs-worker-cdk` template for Lambda deployments
73
73
 
74
74
  ## Support
75
75
 
@@ -16,11 +16,11 @@
16
16
  "skuba-dive": "^2.0.0"
17
17
  },
18
18
  "devDependencies": {
19
- "@types/node": "^20.9.0",
20
- "skuba": "10.0.0-node-22-20250115223210"
19
+ "@types/node": "^22.13.1",
20
+ "skuba": "10.0.0-node-22-20250213035014"
21
21
  },
22
- "packageManager": "pnpm@9.15.3",
22
+ "packageManager": "pnpm@9.15.4",
23
23
  "engines": {
24
- "node": ">=20"
24
+ "node": ">=22"
25
25
  }
26
26
  }
@@ -57,7 +57,7 @@ steps:
57
57
  - *aws-sm
58
58
  - *private-npm
59
59
  - *docker-ecr-cache
60
- - docker-compose#v5.5.0:
60
+ - docker-compose#v5.6.0:
61
61
  run: app
62
62
  environment:
63
63
  - GITHUB_API_TOKEN
@@ -70,7 +70,7 @@ steps:
70
70
  - *aws-sm
71
71
  - *private-npm
72
72
  - *docker-ecr-cache
73
- - seek-jobs/gantry#v3.0.0:
73
+ - seek-jobs/gantry#v4.0.0:
74
74
  command: build
75
75
  file: gantry.build.yml
76
76
  region: <%- region %>
@@ -87,7 +87,7 @@ steps:
87
87
  concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %>
88
88
  key: deploy-dev
89
89
  plugins:
90
- - seek-jobs/gantry#v3.0.0:
90
+ - seek-jobs/gantry#v4.0.0:
91
91
  command: apply
92
92
  environment: <%- devGantryEnvironmentName %>
93
93
  file: gantry.apply.yml
@@ -102,7 +102,7 @@ steps:
102
102
  concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %>
103
103
  depends_on: deploy-dev
104
104
  plugins:
105
- - seek-jobs/gantry#v3.0.0:
105
+ - seek-jobs/gantry#v4.0.0:
106
106
  command: apply
107
107
  environment: <%- prodGantryEnvironmentName %>
108
108
  file: gantry.apply.yml
@@ -9,6 +9,5 @@ image: '{{values "prodAccountId"}}.dkr.ecr.<%- region %>.amazonaws.com/{{values
9
9
  # datadogSecretId: arn:aws:secretsmanager:<%- region %>:<aws-account-id>:secret:<secret-name>
10
10
 
11
11
  tags:
12
- seek:source:sha: '{{.CommitSHA}}'
13
12
  seek:source:url: 'https://github.com/SEEK-Jobs/<%- repoName %>'
14
- # seek:system:name: 'TODO: https://rfc.skinfra.xyz/RFC019-AWS-Tagging-Standard.html#required-tags'
13
+ # seek:system:name: 'TODO: https://rfc.skinfra.xyz/RFC051-AWS-Tagging-Standard.html#tagging-schema'
@@ -1 +1 @@
1
- 20
1
+ 22
@@ -12,7 +12,7 @@ RUN pnpm install --offline --prod
12
12
 
13
13
  ###
14
14
 
15
- FROM gcr.io/distroless/nodejs20-debian12 AS runtime
15
+ FROM gcr.io/distroless/nodejs22-debian12 AS runtime
16
16
 
17
17
  WORKDIR /workdir
18
18
 
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.12
1
+ # syntax=docker/dockerfile:1.13
2
2
 
3
3
  FROM public.ecr.aws/docker/library/node:20-alpine AS dev-deps
4
4
 
@@ -36,7 +36,7 @@
36
36
  "@types/co-body": "^6.1.3",
37
37
  "@types/koa": "^2.13.4",
38
38
  "@types/koa__router": "^12.0.0",
39
- "@types/node": "^20.16.5",
39
+ "@types/node": "^22.13.1",
40
40
  "@types/supertest": "^6.0.0",
41
41
  "chance": "^1.1.8",
42
42
  "mime": "^4.0.1",
@@ -44,8 +44,8 @@
44
44
  "skuba": "*",
45
45
  "supertest": "^7.0.0"
46
46
  },
47
- "packageManager": "pnpm@9.15.3",
47
+ "packageManager": "pnpm@9.15.4",
48
48
  "engines": {
49
- "node": ">=20"
49
+ "node": ">=22"
50
50
  }
51
51
  }
@@ -5,13 +5,13 @@
5
5
  // open-telemetry/opentelemetry-js#3580
6
6
  "DOM",
7
7
 
8
- "ES2022"
8
+ "ES2024"
9
9
  ],
10
10
  "outDir": "lib",
11
11
  "paths": {
12
12
  "src": ["src"]
13
13
  },
14
- "target": "ES2022"
14
+ "target": "ES2024"
15
15
  },
16
16
  "exclude": ["lib*/**/*"],
17
17
  "extends": "skuba/config/tsconfig.json"
@@ -33,7 +33,7 @@ configs:
33
33
  - *aws-sm
34
34
  - *private-npm
35
35
  - *docker-ecr-cache
36
- - docker-compose#v5.5.0:
36
+ - docker-compose#v5.6.0:
37
37
  dependencies: false
38
38
  run: app
39
39
  environment:
@@ -63,7 +63,7 @@ steps:
63
63
  - *aws-sm
64
64
  - *private-npm
65
65
  - *docker-ecr-cache
66
- - docker-compose#v5.5.0:
66
+ - docker-compose#v5.6.0:
67
67
  run: app
68
68
  environment:
69
69
  - GITHUB_API_TOKEN
@@ -1 +1 @@
1
- 20
1
+ 22
@@ -1,9 +1,9 @@
1
- # syntax=docker/dockerfile:1.12
1
+ # syntax=docker/dockerfile:1.13
2
2
 
3
- FROM public.ecr.aws/docker/library/node:20-alpine AS dev-deps
3
+ FROM public.ecr.aws/docker/library/node:22-alpine AS dev-deps
4
4
 
5
5
  # Needed for cdk
6
- RUN apk add --no-cache bash
6
+ RUN apk add --no-cache bash git
7
7
 
8
8
  RUN --mount=type=bind,source=package.json,target=package.json \
9
9
  corepack enable pnpm && corepack install
@@ -227,7 +227,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
227
227
  "Arn",
228
228
  ],
229
229
  },
230
- "Runtime": "nodejs20.x",
230
+ "Runtime": "nodejs22.x",
231
231
  "Tags": [
232
232
  {
233
233
  "Key": "aws-codedeploy-hooks",
@@ -953,7 +953,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
953
953
  "Arn",
954
954
  ],
955
955
  },
956
- "Runtime": "nodejs20.x",
956
+ "Runtime": "nodejs22.x",
957
957
  "Tags": [
958
958
  {
959
959
  "Key": "aws-codedeploy-hooks",
@@ -80,7 +80,7 @@ export class AppStack extends Stack {
80
80
 
81
81
  const worker = new aws_lambda_nodejs.NodejsFunction(this, 'worker', {
82
82
  architecture: aws_lambda.Architecture[architecture],
83
- runtime: aws_lambda.Runtime.NODEJS_20_X,
83
+ runtime: aws_lambda.Runtime.NODEJS_22_X,
84
84
  environmentEncryption: kmsKey,
85
85
  // aws-sdk-v3 sets this to true by default, so it is not necessary to set the environment variable
86
86
  // https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-reusing-connections.html
@@ -89,7 +89,7 @@ export class AppStack extends Stack {
89
89
  timeout: Duration.seconds(30),
90
90
  bundling: {
91
91
  sourceMap: true,
92
- target: 'node20',
92
+ target: 'node22',
93
93
  // aws-sdk-v3 is set as an external module by default, but we want it to be bundled with the function
94
94
  externalModules: [],
95
95
  nodeModules: ['datadog-lambda-js', 'dd-trace'],
@@ -4,7 +4,7 @@ const ENVIRONMENTS = ['dev', 'prod'] as const;
4
4
 
5
5
  type Environment = (typeof ENVIRONMENTS)[number];
6
6
 
7
- export const environment = Env.oneOf(ENVIRONMENTS)('ENVIRONMENT');
7
+ const environment = Env.oneOf(ENVIRONMENTS)('ENVIRONMENT');
8
8
 
9
9
  interface Config {
10
10
  appName: string;
@@ -2,17 +2,15 @@ import { HookStack } from '@seek/aws-codedeploy-infra';
2
2
  import { App } from 'aws-cdk-lib';
3
3
 
4
4
  import { AppStack } from './appStack';
5
- import { config, environment } from './config';
5
+ import { config } from './config';
6
6
 
7
7
  const app = new App();
8
8
 
9
9
  const appStack = new AppStack(app, 'appStack', {
10
10
  stackName: config.appName,
11
11
  tags: {
12
- 'seek:env:label': environment,
13
- 'seek:source:sha': process.env.BUILDKITE_COMMIT ?? 'na',
14
- // 'seek:source:url': 'TODO: add source URL',
15
- // 'seek:system:name': 'TODO: add system name',
12
+ 'seek:source:url': 'https://github.com/SEEK-Jobs/<%- repoName %>',
13
+ // 'seek:system:name': 'TODO: https://rfc.skinfra.xyz/RFC051-AWS-Tagging-Standard.html#tagging-schema',
16
14
  },
17
15
  });
18
16
 
@@ -27,7 +27,7 @@
27
27
  "@seek/aws-codedeploy-infra": "^2.1.0",
28
28
  "@types/aws-lambda": "^8.10.82",
29
29
  "@types/chance": "^1.1.3",
30
- "@types/node": "^20.16.5",
30
+ "@types/node": "^22.13.1",
31
31
  "aws-cdk": "^2.167.1",
32
32
  "aws-cdk-lib": "^2.167.1",
33
33
  "aws-sdk-client-mock": "^4.0.0",
@@ -36,10 +36,10 @@
36
36
  "constructs": "^10.0.17",
37
37
  "datadog-cdk-constructs-v2": "^1.18.0",
38
38
  "pino-pretty": "^13.0.0",
39
- "skuba": "10.0.0-node-22-20250115223210"
39
+ "skuba": "10.0.0-node-22-20250213035014"
40
40
  },
41
- "packageManager": "pnpm@9.15.3",
41
+ "packageManager": "pnpm@9.15.4",
42
42
  "engines": {
43
- "node": ">=20"
43
+ "node": ">=22"
44
44
  }
45
45
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
- "lib": ["ES2022"],
4
+ "lib": ["ES2024"],
5
5
  "outDir": "lib",
6
6
  "paths": {
7
7
  "src": ["src"]
8
8
  },
9
- "target": "ES2022"
9
+ "target": "ES2024"
10
10
  },
11
11
  "exclude": ["lib*/**/*"],
12
12
  "extends": "skuba/config/tsconfig.json"
@@ -25,7 +25,7 @@ jobs:
25
25
  - name: Set up Node.js
26
26
  uses: actions/setup-node@v4
27
27
  with:
28
- node-version: 22.x
28
+ node-version: ^22.14
29
29
 
30
30
  - name: Set up pnpm
31
31
  run: corepack enable pnpm && corepack install
@@ -21,7 +21,7 @@ jobs:
21
21
  - name: Set up Node.js
22
22
  uses: actions/setup-node@v4
23
23
  with:
24
- node-version: 22.x
24
+ node-version: ^22.14
25
25
 
26
26
  - name: Set up pnpm
27
27
  run: corepack enable pnpm && corepack install
@@ -1 +1 @@
1
- 20
1
+ 22
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {},
36
36
  "devDependencies": {
37
- "@types/node": "^20.16.5",
37
+ "@types/node": "^22.13.1",
38
38
  "commitizen": "^4.2.4",
39
39
  "skuba": "*"
40
40
  },
@@ -1 +1 @@
1
- 20
1
+ 22
@@ -34,12 +34,12 @@
34
34
  },
35
35
  "dependencies": {},
36
36
  "devDependencies": {
37
- "@types/node": "^20.16.5",
37
+ "@types/node": "^22.13.1",
38
38
  "commitizen": "^4.2.4",
39
39
  "skuba": "*"
40
40
  },
41
41
  "packageManager": "pnpm@8.15.1",
42
42
  "engines": {
43
- "node": ">=18.12"
43
+ "node": ">=22"
44
44
  }
45
45
  }
@@ -1,108 +0,0 @@
1
- agents:
2
- queue: <%- prodBuildkiteQueueName %>
3
-
4
- configs:
5
- plugins:
6
- - &aws-sm
7
- seek-oss/aws-sm#v2.3.2:
8
- env:
9
- NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
10
-
11
- - &docker-ecr-cache
12
- seek-oss/docker-ecr-cache#v2.2.1: &docker-ecr-cache-defaults
13
- cache-on:
14
- - .npmrc
15
- - package.json#.packageManager
16
- - pnpm-lock.yaml
17
- secrets: id=npm,src=/tmp/.npmrc
18
-
19
- - &private-npm
20
- seek-oss/private-npm#v1.3.0:
21
- env: NPM_READ_TOKEN
22
- output-path: /tmp/
23
-
24
- base-steps:
25
- - &deploy
26
- commands:
27
- - echo '--- pnpm install --offline'
28
- - pnpm install --offline
29
- - echo '+++ pnpm run deploy'
30
- - pnpm run deploy
31
- concurrency: 1
32
- plugins:
33
- - artifacts#v1.9.4:
34
- build: ${BUILDKITE_BUILD_ID}
35
- download: lib/*
36
- - *aws-sm
37
- - *private-npm
38
- - *docker-ecr-cache
39
- - docker-compose#v5.5.0:
40
- dependencies: false
41
- run: app
42
- propagate-environment: true
43
- retry:
44
- manual:
45
- # Only use this if you need to roll back a deployment ASAP.
46
- # Always follow up with a proper revert or fix in Git history.
47
- permit_on_passed: true
48
-
49
- env:
50
- VERSION: ${BUILDKITE_COMMIT:0:7}.${BUILDKITE_BUILD_NUMBER}
51
-
52
- steps:
53
- - label: 🧪 Test, Lint & Build
54
- artifact_paths: lib/**/*
55
- commands:
56
- - echo '--- pnpm install --offline'
57
- - pnpm install --offline
58
- - echo '+++ pnpm test:ci'
59
- - pnpm test:ci
60
- - echo '--- pnpm lint'
61
- - pnpm lint
62
- - echo '--- pnpm build'
63
- - pnpm build
64
- env:
65
- GET_GITHUB_TOKEN: please
66
- plugins:
67
- - *aws-sm
68
- - *private-npm
69
- - *docker-ecr-cache
70
- - docker-compose#v5.5.0:
71
- run: app
72
- environment:
73
- - GITHUB_API_TOKEN
74
- propagate-environment: true
75
- timeout_in_minutes: 10
76
-
77
- - agents:
78
- queue: <%- devBuildkiteQueueName %>
79
- branches: '!renovate-*'
80
- label: 🧖‍♀️ Warm Dev
81
- command: ':'
82
- plugins:
83
- - *aws-sm
84
- - *private-npm
85
- - seek-oss/docker-ecr-cache#v2.2.1:
86
- <<: *docker-ecr-cache-defaults
87
- skip-pull-from-cache: true
88
-
89
- - wait
90
- - block: 🙋🏻‍♀️ Deploy Dev
91
- branches: '!${BUILDKITE_PIPELINE_DEFAULT_BRANCH}'
92
-
93
- - <<: *deploy
94
- agents:
95
- queue: <%- devBuildkiteQueueName %>
96
- env:
97
- ENVIRONMENT: dev
98
- concurrency_group: <%- repoName %>/deploy/dev
99
- label: 🤞 Deploy Dev
100
-
101
- - wait
102
-
103
- - <<: *deploy
104
- env:
105
- ENVIRONMENT: prod
106
- branches: ${BUILDKITE_PIPELINE_DEFAULT_BRANCH}
107
- concurrency_group: <%- repoName %>/deploy/prod
108
- label: 🚀 Deploy Prod
@@ -1 +0,0 @@
1
- ENVIRONMENT=local
@@ -1 +0,0 @@
1
- 20
@@ -1,17 +0,0 @@
1
- # syntax=docker/dockerfile:1.12
2
-
3
- FROM public.ecr.aws/docker/library/node:20-alpine AS dev-deps
4
-
5
- RUN --mount=type=bind,source=package.json,target=package.json \
6
- corepack enable pnpm && corepack install
7
-
8
- RUN --mount=type=bind,source=package.json,target=package.json \
9
- pnpm config set store-dir /root/.pnpm-store
10
-
11
- WORKDIR /workdir
12
-
13
- RUN --mount=type=bind,source=.npmrc,target=.npmrc \
14
- --mount=type=bind,source=package.json,target=package.json \
15
- --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
16
- --mount=type=secret,id=npm,dst=/root/.npmrc,required=true \
17
- pnpm fetch
@@ -1,132 +0,0 @@
1
- # <%- repoName %>
2
-
3
- [![Powered by skuba](https://img.shields.io/badge/🤿%20skuba-powered-009DC4)](https://github.com/seek-oss/skuba)
4
-
5
- Next steps:
6
-
7
- 1. [ ] Finish templating if this was skipped earlier:
8
-
9
- ```shell
10
- pnpm exec skuba configure
11
- ```
12
-
13
- 2. [ ] Create a new repository in the appropriate GitHub organisation.
14
- 3. [ ] Add the repository to BuildAgency;
15
- see our internal [Buildkite Docs] for more information.
16
- 4. [ ] Add Datadog extension, deployment bucket configuration and data classification tags to [serverless.yml](serverless.yml).
17
- 5. [ ] Push local commits to the upstream GitHub branch.
18
- 6. [ ] Configure [GitHub repository settings].
19
- 7. [ ] Delete this checklist 😌.
20
-
21
- [Buildkite Docs]: https://backstage.myseek.xyz/docs/default/component/buildkite-docs
22
- [GitHub repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
23
-
24
- ## Design
25
-
26
- <%-repoName %> is a Node.js [Lambda] application built in line with our [Technical Guidelines].
27
- It is backed by a typical SQS message + dead letter queue configuration and uses common SEEK packages.
28
- Workers enable fault-tolerant asynchronous processing of events.
29
-
30
- The `lambda-sqs-worker` template is modelled after a hypothetical enricher that scores job advertisements.
31
- It's stubbed out with in-memory [scoring service](src/services/jobScorer.ts).
32
- This would be replaced with internal logic or an external service in production.
33
-
34
- This project is deployed with [Serverless].
35
- The Lambda runtime provisions a single Node.js process per container.
36
- The supplied [serverless.yml](serverless.yml) starts out with a minimal `memorySize` which may require tuning based on workload.
37
- Under load, we autoscale horizontally in terms of container count up to `reservedConcurrency`.
38
-
39
- Serverless configures [CodeDeploy] for a blue-green deployment approach.
40
- A smoke test is run against the new version before traffic is switched over,
41
- providing an opportunity to test access and connectivity to online dependencies.
42
- This defaults to an invocation with an empty object `{}`, per [src/hooks.ts](src/hooks.ts).
43
-
44
- ## Development
45
-
46
- ### Test
47
-
48
- ```shell
49
- # Run Jest tests locally
50
- pnpm test
51
-
52
- # Authenticate to dev account
53
- awsauth
54
-
55
- # Run smoke test against deployed application
56
- ENVIRONMENT=dev pnpm smoke
57
- ```
58
-
59
- ### Lint
60
-
61
- ```shell
62
- # Fix issues
63
- pnpm format
64
-
65
- # Check for issues
66
- pnpm lint
67
- ```
68
-
69
- ### Start
70
-
71
- ```shell
72
- # Start a local HTTP server
73
- pnpm start
74
-
75
- # Start with Node.js Inspector enabled
76
- pnpm start:debug
77
- ```
78
-
79
- This serves the Lambda application over HTTP.
80
- For example, to invoke the handler with an empty object `{}` for smoke testing:
81
-
82
- ```shell
83
- curl --data '[{}, {"awsRequestId": "local"}]' --include localhost:<%- port %>
84
- ```
85
-
86
- ### Deploy
87
-
88
- This project is deployed through a [Buildkite pipeline](.buildkite/pipeline.yml).
89
-
90
- - Commits to a feature branch can be deployed to the dev environment by unblocking a step in the Buildkite UI
91
- - Commits to the default branch are automatically deployed to the dev and prod environments in sequence
92
-
93
- To deploy locally:
94
-
95
- ```shell
96
- # Authenticate to dev account
97
- awsauth
98
-
99
- ENVIRONMENT=dev pnpm run deploy
100
- ```
101
-
102
- To rapidly roll back a change,
103
- retry an individual deployment step from the previous build in Buildkite.
104
- Note that this will introduce drift between the head of the default Git branch and the live environment;
105
- use with caution and always follow up with a proper revert or fix in Git history.
106
-
107
- ## Support
108
-
109
- ### Dev
110
-
111
- TODO: add support links for the dev environment.
112
-
113
- <!--
114
- - CloudWatch dashboard
115
- - Datadog dashboard
116
- - Splunk logs
117
- -->
118
-
119
- ### Prod
120
-
121
- TODO: add support links for the prod environment.
122
-
123
- <!--
124
- - CloudWatch dashboard
125
- - Datadog dashboard
126
- - Splunk logs
127
- -->
128
-
129
- [CodeDeploy]: https://docs.aws.amazon.com/codedeploy
130
- [Lambda]: https://docs.aws.amazon.com/lambda
131
- [Serverless]: https://www.serverless.com/
132
- [Technical Guidelines]: https://myseek.atlassian.net/wiki/spaces/AA/pages/2358346017/