skuba 10.0.0-node-22-20250115230358 → 10.0.0-node-22-20250213082332
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.
- package/lib/cli/init/prompts.d.ts +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.0/index.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/10.0.0/index.js.map +1 -1
- package/lib/cli/migrate/nodeVersion/getNode22TypesVersion.d.ts +6 -1
- package/lib/cli/migrate/nodeVersion/getNode22TypesVersion.js +22 -4
- package/lib/cli/migrate/nodeVersion/getNode22TypesVersion.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/index.d.ts +0 -6
- package/lib/cli/migrate/nodeVersion/index.js +16 -29
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/packageJsonChecks.js +1 -1
- package/lib/cli/migrate/nodeVersion/packageJsonChecks.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/utils/template.d.ts +2 -2
- package/lib/utils/template.js +0 -5
- package/lib/utils/template.js.map +2 -2
- package/package.json +14 -14
- package/template/base/tsconfig.json +2 -2
- package/template/express-rest-api/.buildkite/pipeline.yml +4 -4
- package/template/express-rest-api/.gantry/common.yml +1 -2
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +2 -2
- package/template/express-rest-api/package.json +4 -4
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/Dockerfile +2 -2
- package/template/greeter/README.md +1 -1
- package/template/greeter/package.json +4 -4
- package/template/koa-rest-api/.buildkite/pipeline.yml +4 -4
- package/template/koa-rest-api/.gantry/common.yml +1 -2
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/Dockerfile +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
- package/template/koa-rest-api/package.json +3 -3
- package/template/koa-rest-api/tsconfig.json +2 -2
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +3 -3
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +2 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +2 -2
- package/template/lambda-sqs-worker-cdk/infra/config.ts +1 -1
- package/template/lambda-sqs-worker-cdk/infra/index.ts +3 -5
- package/template/lambda-sqs-worker-cdk/package.json +4 -4
- package/template/lambda-sqs-worker-cdk/tsconfig.json +2 -2
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/oss-npm-package/_package.json +1 -1
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/_package.json +2 -2
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +0 -108
- package/template/lambda-sqs-worker/.env +0 -1
- package/template/lambda-sqs-worker/.nvmrc +0 -1
- package/template/lambda-sqs-worker/Dockerfile +0 -17
- package/template/lambda-sqs-worker/README.md +0 -132
- package/template/lambda-sqs-worker/_.npmrc +0 -13
- package/template/lambda-sqs-worker/docker-compose.yml +0 -10
- package/template/lambda-sqs-worker/package.json +0 -45
- package/template/lambda-sqs-worker/serverless.yml +0 -213
- package/template/lambda-sqs-worker/skuba.template.js +0 -33
- package/template/lambda-sqs-worker/src/app.test.ts +0 -116
- package/template/lambda-sqs-worker/src/app.ts +0 -57
- package/template/lambda-sqs-worker/src/config.ts +0 -62
- package/template/lambda-sqs-worker/src/framework/handler.test.ts +0 -61
- package/template/lambda-sqs-worker/src/framework/handler.ts +0 -43
- package/template/lambda-sqs-worker/src/framework/logging.ts +0 -27
- package/template/lambda-sqs-worker/src/framework/metrics.ts +0 -14
- package/template/lambda-sqs-worker/src/framework/validation.test.ts +0 -84
- package/template/lambda-sqs-worker/src/framework/validation.ts +0 -10
- package/template/lambda-sqs-worker/src/hooks.ts +0 -95
- package/template/lambda-sqs-worker/src/mapping/jobScorer.ts +0 -22
- package/template/lambda-sqs-worker/src/services/aws.ts +0 -5
- package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +0 -44
- package/template/lambda-sqs-worker/src/services/jobScorer.ts +0 -59
- package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +0 -40
- package/template/lambda-sqs-worker/src/services/pipelineEventSender.ts +0 -33
- package/template/lambda-sqs-worker/src/testing/handler.ts +0 -13
- package/template/lambda-sqs-worker/src/testing/logging.ts +0 -19
- package/template/lambda-sqs-worker/src/testing/services.ts +0 -28
- package/template/lambda-sqs-worker/src/testing/types.ts +0 -33
- package/template/lambda-sqs-worker/src/types/jobScorer.ts +0 -15
- package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +0 -21
- package/template/lambda-sqs-worker/tsconfig.json +0 -13
|
@@ -57,7 +57,7 @@ steps:
|
|
|
57
57
|
- *aws-sm
|
|
58
58
|
- *private-npm
|
|
59
59
|
- *docker-ecr-cache
|
|
60
|
-
- docker-compose#v5.
|
|
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#
|
|
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#
|
|
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#
|
|
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/
|
|
13
|
+
# seek:system:name: 'TODO: https://rfc.skinfra.xyz/RFC051-AWS-Tagging-Standard.html#tagging-schema'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
22
|
|
@@ -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": "^
|
|
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.
|
|
47
|
+
"packageManager": "pnpm@9.15.4",
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
49
|
+
"node": ">=22"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
// open-telemetry/opentelemetry-js#3580
|
|
6
6
|
"DOM",
|
|
7
7
|
|
|
8
|
-
"
|
|
8
|
+
"ES2024"
|
|
9
9
|
],
|
|
10
10
|
"outDir": "lib",
|
|
11
11
|
"paths": {
|
|
12
12
|
"src": ["src"]
|
|
13
13
|
},
|
|
14
|
-
"target": "
|
|
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.
|
|
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.
|
|
66
|
+
- docker-compose#v5.6.0:
|
|
67
67
|
run: app
|
|
68
68
|
environment:
|
|
69
69
|
- GITHUB_API_TOKEN
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
22
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# syntax=docker/dockerfile:1.
|
|
1
|
+
# syntax=docker/dockerfile:1.13
|
|
2
2
|
|
|
3
|
-
FROM public.ecr.aws/docker/library/node:
|
|
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": "
|
|
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": "
|
|
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.
|
|
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: '
|
|
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
|
-
|
|
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
|
|
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:
|
|
13
|
-
'seek:
|
|
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": "^
|
|
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-
|
|
39
|
+
"skuba": "10.0.0-node-22-20250213082332"
|
|
40
40
|
},
|
|
41
|
-
"packageManager": "pnpm@9.15.
|
|
41
|
+
"packageManager": "pnpm@9.15.4",
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=22"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"baseUrl": ".",
|
|
4
|
-
"lib": ["
|
|
4
|
+
"lib": ["ES2024"],
|
|
5
5
|
"outDir": "lib",
|
|
6
6
|
"paths": {
|
|
7
7
|
"src": ["src"]
|
|
8
8
|
},
|
|
9
|
-
"target": "
|
|
9
|
+
"target": "ES2024"
|
|
10
10
|
},
|
|
11
11
|
"exclude": ["lib*/**/*"],
|
|
12
12
|
"extends": "skuba/config/tsconfig.json"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
22
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
22
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^
|
|
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": ">=
|
|
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
|
-
[](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/
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# managed by skuba
|
|
2
|
-
package-manager-strict-version=true
|
|
3
|
-
public-hoist-pattern[]="@types*"
|
|
4
|
-
public-hoist-pattern[]="*eslint*"
|
|
5
|
-
public-hoist-pattern[]="*prettier*"
|
|
6
|
-
public-hoist-pattern[]="esbuild"
|
|
7
|
-
public-hoist-pattern[]="jest"
|
|
8
|
-
public-hoist-pattern[]="tsconfig-seek"
|
|
9
|
-
# end managed by skuba
|
|
10
|
-
|
|
11
|
-
# Required for Serverless packaging
|
|
12
|
-
node-linker=hoisted
|
|
13
|
-
shamefully-hoist=true
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@seek/<%- serviceName %>",
|
|
3
|
-
"private": true,
|
|
4
|
-
"license": "UNLICENSED",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "skuba build",
|
|
7
|
-
"deploy": "serverless deploy --force --verbose",
|
|
8
|
-
"format": "skuba format",
|
|
9
|
-
"lint": "skuba lint",
|
|
10
|
-
"smoke": "serverless invoke --data '{}' --function Worker",
|
|
11
|
-
"start": "skuba start --port <%- port %>",
|
|
12
|
-
"start:debug": "pnpm --silent start --inspect-brk",
|
|
13
|
-
"test": "skuba test",
|
|
14
|
-
"test:ci": "skuba test --coverage",
|
|
15
|
-
"test:watch": "skuba test --watch"
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@aws-sdk/client-codedeploy": "^3.363.0",
|
|
19
|
-
"@aws-sdk/client-lambda": "^3.363.0",
|
|
20
|
-
"@aws-sdk/client-sns": "^3.363.0",
|
|
21
|
-
"@seek/logger": "^9.0.0",
|
|
22
|
-
"datadog-lambda-js": "^9.0.0",
|
|
23
|
-
"dd-trace": "^5.0.0",
|
|
24
|
-
"skuba-dive": "^2.0.0",
|
|
25
|
-
"zod": "^3.19.1"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@types/aws-lambda": "^8.10.84",
|
|
29
|
-
"@types/chance": "^1.1.3",
|
|
30
|
-
"@types/node": "^20.16.5",
|
|
31
|
-
"aws-sdk-client-mock": "^4.0.0",
|
|
32
|
-
"aws-sdk-client-mock-jest": "^4.0.0",
|
|
33
|
-
"chance": "^1.1.8",
|
|
34
|
-
"pino-pretty": "^13.0.0",
|
|
35
|
-
"serverless": "^3.39.0",
|
|
36
|
-
"serverless-plugin-canary-deployments": "^0.8.0",
|
|
37
|
-
"serverless-plugin-datadog": "^5.12.0",
|
|
38
|
-
"serverless-prune-plugin": "^2.0.0",
|
|
39
|
-
"skuba": "*"
|
|
40
|
-
},
|
|
41
|
-
"packageManager": "pnpm@9.15.3",
|
|
42
|
-
"engines": {
|
|
43
|
-
"node": ">=20"
|
|
44
|
-
}
|
|
45
|
-
}
|