Skip to content

Commit ab96bad

Browse files
AaronMoat72636c
andauthored
oops (#126)
* oops * More oops * Update README.md --------- Co-authored-by: Ryan Ling <[email protected]>
1 parent 0febd9e commit ab96bad

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

packages/hooks/README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,8 @@ Checks for a `user-agent` header that starts with either:
3434

3535
Compatible with Gantry v2.3.7 and newer.
3636

37-
`SKIP_SMOKE` will require additional setup. Consider setting the environment variable on your lambda based on the surrounding CI environment:
38-
39-
```typescript
40-
import { containsSkipDirective } from '@seek/aws-codedeploy-hooks';
41-
42-
const lambdaEnvironment = {
43-
SKIP_SMOKE: containsSkipDirective(process.env.BUILDKITE_MESSAGE, 'smoke')
44-
? 'true'
45-
: undefined,
46-
// ... other environment variables
47-
};
48-
```
37+
`SKIP_SMOKE` will require additional setup. Consider setting the environment variable on your API based on the surrounding CI environment,
38+
like the build message or an explicit environment variable against the build.
4939

5040
### `isLambdaHook`
5141

@@ -59,7 +49,7 @@ while continuing to run the checks as per usual on subsequent health check polli
5949
```typescript
6050
const handler = (event: Event, ctx: Context) => {
6151
if (!Object.entries(event).length) {
62-
if (process.env.SKIP_HOOK && isLambdaHook(event, ctx)) {
52+
if (process.env.SKIP_SMOKE && isLambdaHook(event, ctx)) {
6353
// Expedite deployment even if dependencies are unhealthy.
6454
return;
6555
}
@@ -78,6 +68,19 @@ Checks for:
7868
- An empty event object
7969
- A custom `user-agent` in context that starts with `aws-codedeploy-hook-BeforeAllowTraffic/`
8070

71+
`SKIP_SMOKE` will require additional setup. Consider setting the environment variable on your Lambda function based on the surrounding CI environment:
72+
73+
```typescript
74+
import { containsSkipDirective } from '@seek/aws-codedeploy-hooks';
75+
76+
const lambdaEnvironment = {
77+
SKIP_SMOKE: containsSkipDirective(process.env.BUILDKITE_MESSAGE, 'smoke')
78+
? 'true'
79+
: undefined,
80+
// ... other environment variables
81+
};
82+
```
83+
8184
### `smokeTest.koaMiddleware`
8285

8386
A Koa middleware that executes a smoke test function to check whether the application is broadly operational and ready to serve requests.

0 commit comments

Comments
 (0)