-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
345 lines (312 loc) · 12.2 KB
/
Makefile
File metadata and controls
345 lines (312 loc) · 12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
.PHONY: install build test publish release clean lint compile cdk-synth cdk-deploy cdk-diff react-dev react-build react-start react-lint check-licenses cdk-synth-no-mock cdk-synth-mock cdk-synth-stateful-resources-no-mock cdk-synth-stateless-resources-no-mock cdk-synth-stateful-resources-mock cdk-synth-stateless-resources-mock
install: install-node install-python install-hooks
install-python:
poetry install
install-node:
npm ci
install-hooks: install-python
poetry run pre-commit install --install-hooks --overwrite
compile-node:
npx tsc --build tsconfig.build.json
compile: compile-node
lint-node: compile-node
npm run lint --workspace packages/common/commonTypes
npm run lint --workspace packages/cloudfrontFunctions
npm run lint --workspace packages/cdk
npm run lint --workspace packages/cognito
npm run lint --workspace packages/prescriptionListLambda
npm run lint --workspace packages/prescriptionDetailsLambda
npm run lint --workspace packages/patientSearchLambda
npm run lint --workspace packages/common/testing
npm run lint --workspace packages/common/middyErrorHandler
npm run lint --workspace packages/common/pdsClient
npm run lint --workspace packages/common/lambdaUtils
npm run lint --workspace packages/trackerUserInfoLambda
npm run lint --workspace packages/sessionManagementLambda
npm run lint --workspace packages/selectedRoleLambda
npm run lint --workspace packages/CIS2SignOutLambda
npm run lint --workspace packages/common/authFunctions
npm run lint --workspace packages/common/doHSClient
npm run lint --workspace packages/common/dynamoFunctions
npm run lint --workspace packages/testingSupport/clearActiveSessions
npm run lint --workspace packages/testingSupport/setLastActivityTime
lint-githubactions:
actionlint
lint-githubaction-scripts:
shellcheck .github/scripts/*.sh
lint: lint-node lint-githubactions lint-githubaction-scripts react-lint
test: compile
npm run test --workspace packages/cloudfrontFunctions
npm run test --workspace packages/cdk
npm run test --workspace packages/cpt-ui
npm run test --workspace packages/cognito
npm run test --workspace packages/prescriptionListLambda
npm run test --workspace packages/prescriptionDetailsLambda
npm run test --workspace packages/patientSearchLambda
npm run test --workspace packages/common/middyErrorHandler
npm run test --workspace packages/common/pdsClient
npm run test --workspace packages/common/lambdaUtils
npm run test --workspace packages/trackerUserInfoLambda
npm run test --workspace packages/sessionManagementLambda
npm run test --workspace packages/selectedRoleLambda
npm run test --workspace packages/CIS2SignOutLambda
npm run test --workspace packages/common/authFunctions
npm run test --workspace packages/common/doHSClient
npm run test --workspace packages/common/dynamoFunctions
npm run test --workspace packages/testingSupport/clearActiveSessions
npm run test --workspace packages/testingSupport/setLastActivityTime
clean:
find . -name 'coverage' -type d -prune -exec rm -rf '{}' +
find . -name 'lib' -type d -prune -exec rm -rf '{}' +
rm -rf cdk.out
rm -rf .local_config
rm -rf cfn_guard_output
deep-clean: clean
rm -rf .venv
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
check-licenses: check-licenses-node check-licenses-python
check-licenses-node:
npm run check-licenses
npm run check-licenses --workspace packages/common/commonTypes
npm run check-licenses --workspace packages/cloudfrontFunctions
npm run check-licenses --workspace packages/cdk
npm run check-licenses --workspace packages/cpt-ui
npm run check-licenses --workspace packages/common/authFunctions
npm run check-licenses --workspace packages/common/doHSClient
npm run check-licenses --workspace packages/common/dynamoFunctions
npm run check-licenses --workspace packages/cognito
npm run check-licenses --workspace packages/prescriptionListLambda
npm run check-licenses --workspace packages/prescriptionDetailsLambda
npm run check-licenses --workspace packages/patientSearchLambda
npm run check-licenses --workspace packages/trackerUserInfoLambda
npm run check-licenses --workspace packages/sessionManagementLambda
npm run check-licenses --workspace packages/selectedRoleLambda
npm run check-licenses --workspace packages/CIS2SignOutLambda
npm run check-licenses --workspace packages/testingSupport/clearActiveSessions
npm run check-licenses --workspace packages/testingSupport/setLastActivityTime
react-dev:
npm run dev --workspace packages/cpt-ui
react-build:
export BASE_PATH=/site && npm run build --workspace packages/cpt-ui
react-start:
npm run start --workspace packages/cpt-ui
react-lint:
npm run lint --workspace packages/cpt-ui
cdk-deploy: guard-service_name guard-CDK_APP_NAME
REQUIRE_APPROVAL="$${REQUIRE_APPROVAL:-any-change}" && \
VERSION_NUMBER="$${VERSION_NUMBER:-undefined}" && \
COMMIT_ID="$${COMMIT_ID:-undefined}" && \
npx cdk deploy \
--app "npx ts-node --prefer-ts-exts packages/cdk/bin/$$CDK_APP_NAME.ts" \
--all \
--ci true \
--require-approval $${REQUIRE_APPROVAL} \
--context serviceName=$$service_name \
--context VERSION_NUMBER=$$VERSION_NUMBER \
--context COMMIT_ID=$$COMMIT_ID
cdk-watch:
./scripts/run_sync.sh
cdk-synth: compile cdk-synth-no-mock cdk-synth-mock
cdk-synth-no-mock: cdk-synth-stateful-resources-no-mock cdk-synth-stateless-resources-no-mock
cdk-synth-mock: cdk-synth-stateful-resources-mock cdk-synth-stateless-resources-mock
cdk-synth-stateful-resources-no-mock:
mkdir -p .local_config
CDK_APP_NAME=StatefulResourcesApp \
SERVICE_NAME=cpt-ui \
VERSION_NUMBER=undefined \
COMMIT_ID=undefined \
AUTO_DELETE_OBJECTS=true \
CLOUDFRONT_DISTRIBUTION_ID=123 \
CLOUDFRONT_CERT_ARN=arn:aws:acm:us-east-1:444455556666:certificate/certificate_ID \
SHORT_CLOUDFRONT_DOMAIN=dummy \
FULL_CLOUDFRONT_DOMAIN=dummy.local \
EPS_DOMAIN_NAME=dummy.local \
FULL_COGNITO_DOMAIN=dummy.local \
RUM_LOG_GROUP_ARN=123 \
RUM_APP_NAME=dummy \
EPS_HOSTED_ZONE_ID=123 \
USE_MOCK_OIDC=false \
PRIMARY_OIDC_CLIENT_ID=undefined \
PRIMARY_OIDC_ISSUER=undefined \
PRIMARY_OIDC_AUTHORIZE_ENDPOINT=undefined \
PRIMARY_OIDC_TOKEN_ENDPOINT=undefined \
PRIMARY_OIDC_USERINFO_ENDPOINT=undefined \
PRIMARY_OIDC_JWKS_ENDPOINT=undefined \
LOG_RETENTION_IN_DAYS=30 \
LOG_LEVEL=debug \
USE_CUSTOM_COGNITO_DOMAIN=true \
ALLOW_LOCALHOST_ACCESS=false \
WAF_ALLOW_GA_RUNNER_CONNECTIVITY=true \
CLOUDFRONT_ORIGIN_CUSTOM_HEADER=foo \
SPLUNK_DELIVERY_STREAM=foo \
SPLUNK_SUBSCRIPTION_FILTER_ROLE=foo \
DO_NOT_GET_AWS_EXPORT=true \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
FORWARD_CSOC_LOGS=true \
./.github/scripts/fix_cdk_json.sh .local_config/stateful_app.config.json
CONFIG_FILE_NAME=.local_config/stateful_app.config.json npx cdk synth \
--quiet \
--app "npx ts-node --prefer-ts-exts packages/cdk/bin/StatefulResourcesApp.ts"
cdk-synth-stateless-resources-no-mock:
mkdir -p .local_config
CDK_APP_NAME=StatelessResourcesApp \
SERVICE_NAME=cpt-ui \
VERSION_NUMBER=undefined \
COMMIT_ID=undefined \
AUTO_DELETE_OBJECTS=true \
LOG_RETENTION_IN_DAYS=30 \
LOG_LEVEL=debug \
EPS_DOMAIN_NAME=dummy.local \
EPS_HOSTED_ZONE_ID=123 \
CLOUDFRONT_DISTRIBUTION_ID=123 \
SHORT_CLOUDFRONT_DOMAIN=dummy \
FULL_CLOUDFRONT_DOMAIN=dummy.local \
FULL_COGNITO_DOMAIN=dummy.local \
RUM_LOG_GROUP_ARN=123 \
RUM_APP_NAME=dummy \
PRIMARY_OIDC_CLIENT_ID=undefined \
PRIMARY_OIDC_ISSUER=undefined \
PRIMARY_OIDC_AUTHORIZE_ENDPOINT=undefined \
PRIMARY_OIDC_TOKEN_ENDPOINT=undefined \
PRIMARY_OIDC_USERINFO_ENDPOINT=undefined \
PRIMARY_OIDC_JWKS_ENDPOINT=undefined \
USE_MOCK_OIDC=false \
APIGEE_API_KEY=foo \
APIGEE_API_SECRET=foo \
APIGEE_DOHS_API_KEY=foo \
APIGEE_CIS2_TOKEN_ENDPOINT=foo \
APIGEE_PRESCRIPTION_ENDPOINT=foo \
APIGEE_PERSONAL_DEMOGRAPHICS_ENDPOINT=foo \
APIGEE_DOHS_ENDPOINT=foo \
WEBACL_ATTRIBUTE_ARN=foo \
WEBACL_ATTRIBUTE_ARN=foo \
JWT_KID=foo \
ROLE_ID=foo \
ALLOW_LOCALHOST_ACCESS=false \
WAF_ALLOW_GA_RUNNER_CONNECTIVITY=true \
GITHUB_ACTIONS_RUNNER_IPV4='["127.0.0.1"]' \
GITHUB_ACTIONS_RUNNER_IPV6='["::1"]' \
CLOUDFRONT_CERT_ARN=arn:aws:acm:us-east-1:444455556666:certificate/certificate_ID \
DO_NOT_GET_AWS_EXPORT=true \
CLOUDFRONT_ORIGIN_CUSTOM_HEADER=foo \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
FORWARD_CSOC_LOGS=true \
./.github/scripts/fix_cdk_json.sh .local_config/stateless_app.config.json
CONFIG_FILE_NAME=.local_config/stateless_app.config.json npx cdk synth \
--quiet \
--app "npx ts-node --prefer-ts-exts packages/cdk/bin/StatelessResourcesApp.ts" \
cdk-synth-stateful-resources-mock:
mkdir -p .local_config
CDK_APP_NAME=StatefulResourcesApp \
SERVICE_NAME=cpt-ui \
VERSION_NUMBER=undefined \
COMMIT_ID=undefined \
AUTO_DELETE_OBJECTS=true \
CLOUDFRONT_DISTRIBUTION_ID=123 \
CLOUDFRONT_CERT_ARN=arn:aws:acm:us-east-1:444455556666:certificate/certificate_ID \
SHORT_CLOUDFRONT_DOMAIN=dummy \
FULL_CLOUDFRONT_DOMAIN=dummy.local \
EPS_DOMAIN_NAME=dummy.local \
FULL_COGNITO_DOMAIN=dummy.local \
RUM_LOG_GROUP_ARN=123 \
RUM_APP_NAME=dummy \
EPS_HOSTED_ZONE_ID=123 \
USE_MOCK_OIDC=true \
PRIMARY_OIDC_CLIENT_ID=undefined \
PRIMARY_OIDC_ISSUER=undefined \
PRIMARY_OIDC_AUTHORIZE_ENDPOINT=undefined \
PRIMARY_OIDC_TOKEN_ENDPOINT=undefined \
PRIMARY_OIDC_USERINFO_ENDPOINT=undefined \
PRIMARY_OIDC_JWKS_ENDPOINT=undefined \
MOCK_OIDC_CLIENT_ID=undefined \
MOCK_OIDC_ISSUER=undefined \
MOCK_OIDC_AUTHORIZE_ENDPOINT=undefined \
MOCK_OIDC_TOKEN_ENDPOINT=undefined \
MOCK_OIDC_USERINFO_ENDPOINT=undefined \
MOCK_OIDC_JWKS_ENDPOINT=undefined \
LOG_RETENTION_IN_DAYS=30 \
LOG_LEVEL=debug \
USE_CUSTOM_COGNITO_DOMAIN=true \
ALLOW_LOCALHOST_ACCESS=false \
WAF_ALLOW_GA_RUNNER_CONNECTIVITY=true \
CLOUDFRONT_ORIGIN_CUSTOM_HEADER=foo \
SPLUNK_DELIVERY_STREAM=foo \
SPLUNK_SUBSCRIPTION_FILTER_ROLE=foo \
DO_NOT_GET_AWS_EXPORT=true \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
FORWARD_CSOC_LOGS=true \
./.github/scripts/fix_cdk_json.sh .local_config/stateful_app.config.json
CONFIG_FILE_NAME=.local_config/stateful_app.config.json npx cdk synth \
--quiet \
--app "npx ts-node --prefer-ts-exts packages/cdk/bin/StatefulResourcesApp.ts"
cdk-synth-stateless-resources-mock:
mkdir -p .local_config
CDK_APP_NAME=StatelessResourcesApp \
SERVICE_NAME=cpt-ui \
VERSION_NUMBER=undefined \
COMMIT_ID=undefined \
AUTO_DELETE_OBJECTS=true \
LOG_RETENTION_IN_DAYS=30 \
LOG_LEVEL=debug \
EPS_DOMAIN_NAME=dummy.local \
EPS_HOSTED_ZONE_ID=123 \
CLOUDFRONT_DISTRIBUTION_ID=123 \
SHORT_CLOUDFRONT_DOMAIN=dummy \
FULL_CLOUDFRONT_DOMAIN=dummy.local \
FULL_COGNITO_DOMAIN=dummy.local \
RUM_LOG_GROUP_ARN=123 \
RUM_APP_NAME=dummy \
PRIMARY_OIDC_CLIENT_ID=undefined \
PRIMARY_OIDC_ISSUER=undefined \
PRIMARY_OIDC_AUTHORIZE_ENDPOINT=undefined \
PRIMARY_OIDC_TOKEN_ENDPOINT=undefined \
PRIMARY_OIDC_USERINFO_ENDPOINT=undefined \
PRIMARY_OIDC_JWKS_ENDPOINT=undefined \
MOCK_OIDC_CLIENT_ID=undefined \
MOCK_OIDC_ISSUER=undefined \
MOCK_OIDC_AUTHORIZE_ENDPOINT=undefined \
MOCK_OIDC_TOKEN_ENDPOINT=undefined \
MOCK_OIDC_USERINFO_ENDPOINT=undefined \
MOCK_OIDC_JWKS_ENDPOINT=undefined \
USE_MOCK_OIDC=true \
WEBACL_ATTRIBUTE_ARN=foo \
APIGEE_API_KEY=foo \
APIGEE_API_SECRET=foo \
APIGEE_DOHS_API_KEY=foo \
APIGEE_CIS2_TOKEN_ENDPOINT=foo \
APIGEE_MOCK_TOKEN_ENDPOINT=foo \
APIGEE_PRESCRIPTION_ENDPOINT=foo \
APIGEE_PERSONAL_DEMOGRAPHICS_ENDPOINT=foo \
APIGEE_DOHS_ENDPOINT=foo \
JWT_KID=foo \
ROLE_ID=foo \
ALLOW_LOCALHOST_ACCESS=false \
CLOUDFRONT_CERT_ARN=arn:aws:acm:us-east-1:444455556666:certificate/certificate_ID \
WAF_ALLOW_GA_RUNNER_CONNECTIVITY=true \
GITHUB_ACTIONS_RUNNER_IPV4='["127.0.0.1"]' \
GITHUB_ACTIONS_RUNNER_IPV6='["::1"]' \
DO_NOT_GET_AWS_EXPORT=true \
CLOUDFRONT_ORIGIN_CUSTOM_HEADER=foo \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
FORWARD_CSOC_LOGS=true \
./.github/scripts/fix_cdk_json.sh .local_config/stateless_app.config.json
CONFIG_FILE_NAME=.local_config/stateless_app.config.json npx cdk synth \
--quiet \
--app "npx ts-node --prefer-ts-exts packages/cdk/bin/StatelessResourcesApp.ts"
cdk-diff: guard-CDK_APP_NAME
npx cdk diff \
--app "npx ts-node --prefer-ts-exts packages/cdk/bin/$$CDK_APP_NAME.ts" \
--context serviceName=$$service_name \
--context VERSION_NUMBER=$$VERSION_NUMBER \
--context COMMIT_ID=$$COMMIT_ID
%:
@$(MAKE) -f /usr/local/share/eps/Mk/common.mk $@