You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/hooks/README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,36 @@ Compatible with Gantry v2.3.7 and newer.
37
37
`SKIP_SMOKE` will require additional setup. Consider setting the environment variable on your API based on the surrounding CI environment,
38
38
like the build message or an explicit environment variable against the build.
39
39
40
+
For example, your Gantry resource file could look like this:
41
+
42
+
```yaml
43
+
kind: Service
44
+
env:
45
+
SKIP_SMOKE: '{{ with env "BUILDKITE_MESSAGE" | lower }}{{ if contains "[skip smoke]" . }}true{{ else }}false{{ end }}{{ end }}'
46
+
```
47
+
48
+
Or, some magic to handle combinations like `[skip ci dev-deploy smoke]`:
49
+
50
+
```yaml
51
+
kind: Service
52
+
env:
53
+
SKIP_SMOKE: '{{ with env "BUILDKITE_MESSAGE" | lower }}{{ if regexMatch "\\[skip\\b[^\\]]*\\bsmoke\\b[^\\]]*\\]" . }}true{{ else }}false{{ end }}{{ end }}'
54
+
```
55
+
56
+
With these in place,
57
+
you can push a new commit or manually create a new build that includes `[skip smoke]` somewhere in its title:
58
+
59
+
```yaml
60
+
[skip smoke] Re-deploy for disaster recovery
61
+
Re-deploy for disaster recovery [sKiP SmOkE]
62
+
63
+
# you can also work with multiple directives if you chose the magic approach
64
+
[skip ci smoke] Re-deploy for disaster recovery
65
+
Please [skip smoke dev-deploy] work
66
+
```
67
+
68
+
The resulting Buildkite build will set `process.env.SKIP_SMOKE = true` on the ECS task and enable it to skip pre-deployment checks.
69
+
40
70
### `isLambdaHook`
41
71
42
72
Whether the Lambda invocation originated from AWS CodeDeploy Hooks.
@@ -81,6 +111,20 @@ const lambdaEnvironment = {
81
111
};
82
112
```
83
113
114
+
With this in place,
115
+
you can push a new commit or manually create a new build that includes `[skip smoke]` somewhere in its title:
116
+
117
+
```yaml
118
+
[skip smoke] Re-deploy for disaster recovery
119
+
Re-deploy for disaster recovery [sKiP SmOkE]
120
+
121
+
# you can also work with multiple directives
122
+
[skip ci smoke] Re-deploy for disaster recovery
123
+
Please [skip smoke dev-deploy] work
124
+
```
125
+
126
+
The resulting Buildkite build will set `process.env.SKIP_SMOKE = true` on the Lambda function and enable it to skip pre-deployment checks.
127
+
84
128
### `smokeTest.koaMiddleware`
85
129
86
130
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