-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
228 lines (201 loc) · 10 KB
/
Makefile
File metadata and controls
228 lines (201 loc) · 10 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
.PHONY: install build test publish release clean lint compile
install: install-node install-python install-hooks
install-python:
poetry install
install-node:
npm ci --ignore-scripts
install-hooks: install-python
poetry run pre-commit install --install-hooks --overwrite
sam-build: sam-validate compile
sam build --template-file SAMtemplates/main_template.yaml --region eu-west-2
sam-build-sandbox: sam-validate-sandbox compile
sam build --template-file SAMtemplates/sandbox_template.yaml --region eu-west-2
sam-run-local: sam-build
sam local start-api
sam-sync: guard-AWS_DEFAULT_PROFILE guard-stack_name compile
sam sync \
--stack-name $$stack_name \
--watch \
--template-file SAMtemplates/main_template.yaml \
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
--parameter-overrides \
TruststoreVersion=$${TRUSTSTORE_VERSION:-none} \
EnableMutualTLS=$${ENABLE_MUTUAL_TLS:-false} \
EnableSplunk=false \
EnableDynamoDBAutoScaling=$${DYNAMODB_AUTOSCALE:-true} \
VersionNumber=$${VERSION_NUMBER:-dev} \
CommitId=$${COMMIT_ID:-local} \
LogLevel=$${LOG_LEVEL:-INFO} \
LogRetentionInDays=$${LOG_RETENTION_DAYS:-30} \
DeployCheckPrescriptionStatusUpdate=true \
EnableAlerts=false \
Environment=$$AWS_ENVIRONMENT \
StateMachineLogLevel=$${STATE_MACHINE_LOG_LEVEL:-ALL} \
RequireApplicationName=$${REQUIRE_APPLICATION_NAME:-false} \
ForwardCsocLogs=$${FORWARD_CSOC_LOGS:-false} \
TestPresciptionsParamValue1=$${TEST_PRESCRIPTIONS_1:-PLACEHOLDER} \
TestPresciptionsParamValue2=$${TEST_PRESCRIPTIONS_2:-PLACEHOLDER} \
TestPresciptionsParamValue3=$${TEST_PRESCRIPTIONS_3:-PLACEHOLDER} \
TestPresciptionsParamValue4=$${TEST_PRESCRIPTIONS_4:-PLACEHOLDER} \
"EnabledSystemsValue=$${ENABLED_SYSTEMS:-Internal Test System}" \
"EnabledSiteODSCodesValue=$${ENABLED_SITE_ODS_CODES:-A83008,FA565}" \
BlockedSiteODSCodesValue=$${BLOCKED_SITE_ODS_CODES:-XXXXX} \
EnabledSupplierApplicationIDsValue=$${ENABLED_SUPPLIER_APPLICATION_IDS:-XXXXX} \
NotifyRoutingPlanIDValue=$${NOTIFY_ROUTING_PLAN_ID:-e57fe5cc-0567-4854-abe2-b7dd9014a50c} \
NotifyAPIBaseURLValue=$${NOTIFY_API_BASE_URL:-https://int.api.service.nhs.uk} \
EnableNotificationsInternal=$${ENABLE_NOTIFICATIONS_INTERNAL:-true} \
EnableNotificationsExternal=$${ENABLE_NOTIFICATIONS_EXTERNAL:-false} \
EnableBackup=$${ENABLE_BACKUP:-False}
sam-deploy: guard-AWS_DEFAULT_PROFILE guard-stack_name
sam deploy \
--stack-name $$stack_name \
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
--parameter-overrides \
TruststoreVersion=$${TRUSTSTORE_VERSION:-none} \
EnableMutualTLS=$${ENABLE_MUTUAL_TLS:-false} \
EnableSplunk=false \
EnableDynamoDBAutoScaling=$${DYNAMODB_AUTOSCALE:-true} \
VersionNumber=$${VERSION_NUMBER:-dev} \
CommitId=$${COMMIT_ID:-local} \
LogLevel=$${LOG_LEVEL:-INFO} \
LogRetentionInDays=$${LOG_RETENTION_DAYS:-30} \
DeployCheckPrescriptionStatusUpdate=true \
EnableAlerts=false \
Environment=$$AWS_ENVIRONMENT \
StateMachineLogLevel=$${STATE_MACHINE_LOG_LEVEL:-ALL} \
RequireApplicationName=$${REQUIRE_APPLICATION_NAME:-false} \
ForwardCsocLogs=$${FORWARD_CSOC_LOGS:-false} \
TestPresciptionsParamValue1=$${TEST_PRESCRIPTIONS_1:-PLACEHOLDER} \
TestPresciptionsParamValue2=$${TEST_PRESCRIPTIONS_2:-PLACEHOLDER} \
TestPresciptionsParamValue3=$${TEST_PRESCRIPTIONS_3:-PLACEHOLDER} \
TestPresciptionsParamValue4=$${TEST_PRESCRIPTIONS_4:-PLACEHOLDER} \
"EnabledSystemsValue=$${ENABLED_SYSTEMS:-Internal Test System}" \
"EnabledSiteODSCodesValue=$${ENABLED_SITE_ODS_CODES:-A83008,FA565}" \
BlockedSiteODSCodesValue=$${BLOCKED_SITE_ODS_CODES:-XXXXX} \
EnabledSupplierApplicationIDsValue=$${ENABLED_SUPPLIER_APPLICATION_IDS:-XXXXX} \
NotifyRoutingPlanIDValue=$${NOTIFY_ROUTING_PLAN_ID:-e57fe5cc-0567-4854-abe2-b7dd9014a50c} \
NotifyAPIBaseURLValue=$${NOTIFY_API_BASE_URL:-https://int.api.service.nhs.uk} \
EnableNotificationsInternal=$${ENABLE_NOTIFICATIONS_INTERNAL:-true} \
EnableNotificationsExternal=$${ENABLE_NOTIFICATIONS_EXTERNAL:-false} \
EnableBackup=$${ENABLE_BACKUP:-False}
sam-delete: guard-AWS_DEFAULT_PROFILE guard-stack_name
sam delete --stack-name $$stack_name
sam-list-endpoints: guard-AWS_DEFAULT_PROFILE guard-stack_name
sam list endpoints --stack-name $$stack_name
sam-list-resources: guard-AWS_DEFAULT_PROFILE guard-stack_name
sam list resources --stack-name $$stack_name
sam-list-outputs: guard-AWS_DEFAULT_PROFILE guard-stack_name
sam list stack-outputs --stack-name $$stack_name
sam-validate:
sam validate --template-file SAMtemplates/main_template.yaml --region eu-west-2
sam validate --template-file SAMtemplates/apis/main.yaml --region eu-west-2
sam validate --template-file SAMtemplates/apis/api_resources.yaml --region eu-west-2
sam validate --template-file SAMtemplates/functions/main.yaml --region eu-west-2
sam validate --template-file SAMtemplates/functions/lambda_resources.yaml --region eu-west-2
sam validate --template-file SAMtemplates/tables/main.yaml --region eu-west-2
sam validate --template-file SAMtemplates/tables/dynamodb_resources.yaml --region eu-west-2
sam validate --template-file SAMtemplates/state_machines/main.yaml --region eu-west-2
sam validate --template-file SAMtemplates/state_machines/state_machine_resources.yaml --region eu-west-2
sam validate --template-file SAMtemplates/alarms/main.yaml --region eu-west-2
sam-validate-sandbox:
sam validate --template-file SAMtemplates/sandbox_template.yaml --region eu-west-2
sam-deploy-package: guard-artifact_bucket guard-artifact_bucket_prefix guard-stack_name guard-template_file guard-cloud_formation_execution_role guard-LATEST_TRUSTSTORE_VERSION guard-enable_mutual_tls guard-DYNAMODB_AUTOSCALE guard-VERSION_NUMBER guard-COMMIT_ID guard-VERSION_NUMBER guard-LOG_RETENTION_DAYS guard-TARGET_ENVIRONMENT
sam deploy \
--template-file $$template_file \
--stack-name $$stack_name \
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
--region eu-west-2 \
--s3-bucket $$artifact_bucket \
--s3-prefix $$artifact_bucket_prefix \
--config-file samconfig_package_and_deploy.toml \
--no-fail-on-empty-changeset \
--role-arn $$cloud_formation_execution_role \
--no-confirm-changeset \
--force-upload \
--tags "version=$$VERSION_NUMBER cloudFormationStack=$$stack_name" \
--parameter-overrides \
TruststoreVersion=$$LATEST_TRUSTSTORE_VERSION \
EnableMutualTLS=$$enable_mutual_tls \
EnableSplunk=true \
EnableDynamoDBAutoScaling=$$DYNAMODB_AUTOSCALE \
VersionNumber=$$VERSION_NUMBER \
CommitId=$$COMMIT_ID \
LogLevel=$$LOG_LEVEL \
LogRetentionInDays=$$LOG_RETENTION_DAYS \
Environment=$$TARGET_ENVIRONMENT \
DeployCheckPrescriptionStatusUpdate=$$DEPLOY_CHECK_PRESCRIPTION_STATUS_UPDATE \
EnableAlerts=$$ENABLE_ALERTS \
StateMachineLogLevel=$$STATE_MACHINE_LOG_LEVEL \
EnableNotificationsInternal=$$ENABLE_NOTIFICATIONS_INTERNAL \
EnableNotificationsExternal=$$ENABLE_NOTIFICATIONS_EXTERNAL \
EnableBackup=$$ENABLE_BACKUP
compile-node:
npx tsc --build tsconfig.build.json
compile-specification:
npm run resolve --workspace packages/specification/
npm run resolve-cpsu --workspace packages/specification/
compile: compile-node compile-specification
lint-node: compile-node
npm run lint --workspace packages/updatePrescriptionStatus
npm run lint --workspace packages/gsul
npm run lint --workspace packages/nhsd-psu-sandbox
npm run lint --workspace packages/statusLambda
npm run lint --workspace packages/capabilityStatement
npm run lint --workspace packages/cpsuLambda
npm run lint --workspace packages/checkPrescriptionStatusUpdates
npm run lint --workspace packages/nhsNotifyLambda
npm run lint --workspace packages/postDatedLambda
npm run lint --workspace packages/nhsNotifyUpdateCallback
npm run lint --workspace packages/common/testing
npm run lint --workspace packages/common/middyErrorHandler
npm run lint --workspace packages/common/commonTypes
npm run lint --workspace packages/psuRestoreValidationLambda
lint-specification: compile-specification
npm run lint --workspace packages/specification
lint-python:
poetry run flake8 scripts/*.py --config .flake8
lint: lint-node lint-python lint-specification
test: compile
npm run test --workspace packages/updatePrescriptionStatus
npm run test --workspace packages/gsul
npm run test --workspace packages/nhsd-psu-sandbox
npm run test --workspace packages/statusLambda
npm run test --workspace packages/capabilityStatement
npm run test --workspace packages/cpsuLambda
npm run test --workspace packages/checkPrescriptionStatusUpdates
npm run test --workspace packages/nhsNotifyLambda
npm run test --workspace packages/postDatedLambda
npm run test --workspace packages/nhsNotifyUpdateCallback
npm run test --workspace packages/common/middyErrorHandler
npm run test --workspace packages/psuRestoreValidationLambda
npm run test --workspace packages/common/utilities
clean:
rm -rf packages/updatePrescriptionStatus/coverage
rm -rf packages/updatePrescriptionStatus/lib
rm -rf packages/nhsd-psu-sandbox/coverage
rm -rf packages/nhsd-psu-sandbox/lib
rm -rf packages/specification/coverage
rm -rf packages/specification/lib
rm -rf packages/statusLambda/coverage
rm -rf packages/statusLambda/lib
rm -rf packages/capabilityStatement/coverage
rm -rf packages/capabilityStatement/lib
rm -rf packages/cpsuLambda/coverage
rm -rf packages/cpsuLambda/lib
rm -rf packages/nhsNotifyLambda/coverage
rm -rf packages/nhsNotifyLambda/lib
rm -rf packages/postDatedLambda/coverage
rm -rf packages/postDatedLambda/lib
rm -rf packages/nhsNotifyUpdateCallback/coverage
rm -rf packages/nhsNotifyUpdateCallback/lib
rm -rf packages/checkPrescriptionStatusUpdates/lib
rm -rf packages/common/testing/lib
rm -rf packages/common/middyErrorHandler/lib
rm -rf packages/common/commonTypes/lib
rm -rf .aws-sam
deep-clean: clean
rm -rf venv
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
poetry env remove --all
%:
@$(MAKE) -f /usr/local/share/eps/Mk/common.mk $@