Skip to content

Commit 56b4499

Browse files
authored
Merge pull request #44 from NHSDigital/AMB-1741_refactor_terraform
Amb 1741 refactor terraform
2 parents ba31adf + 87508cf commit 56b4499

File tree

114 files changed

+3961
-2058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+3961
-2058
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
22
max-line-length=121
3-
exclude = .git,__pycache__,dist,.venv/*,node_modules/*,utils/*,tests/.venv/*
3+
exclude = .git,__pycache__,dist,.venv/*,node_modules/*,utils/*,tests/.venv/*,dynamodb/*,lambda_code/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ terraform/zips
2323
.python-version
2424
**/.terraform/
2525
sandbox/specification/
26+
.vscode/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ build-proxy:
3838
scripts/build_proxy.sh
3939

4040
#Files to loop over in release
41-
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests specification sandbox terraform lambda_typescript scripts catch_all_lambda"
41+
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests specification sandbox terraform scripts lambda_code"
4242

4343
#Create /dist/ sub-directory and copy files into directory
4444
release: clean publish build-proxy

azure/azure-build-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ extends:
3131
service_name: ${{ variables.service_name }}
3232
short_service_name: ${{ variables.short_service_name }}
3333
post_ecs_push:
34-
- template: ./templates/build-sandbox-image.yml
34+
- template: ./templates/build.yml

azure/templates/build-sandbox-image.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

azure/templates/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
steps:
2+
- bash: |
3+
docker build -t imms-lambda-build .
4+
docker run --rm -v $(shell pwd)/build:/build imms-lambda-build
5+
6+
displayName: Build and test lambda code
7+
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/lambda_code"
8+
- bash: |
9+
mkdir -p build
10+
npm run publish 2> /dev/null
11+
cp build/immunisation-fhir-api.json sandbox/
12+
13+
cd sandbox
14+
docker build -t sandbox .
15+
displayName: Build sandbox image
16+
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)"

azure/templates/post-deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ steps:
1010
parameters:
1111
role: "auto-ops"
1212
profile: "apm_ptl"
13-
13+
1414
- template: "azure/components/get-aws-secrets-and-ssm-params.yml@common"
1515
parameters:
1616
secret_file_ids:
@@ -26,7 +26,7 @@ steps:
2626
workingDirectory: $(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)
2727
displayName: Setup pytests
2828
condition: always()
29-
29+
3030
- template: "azure/components/aws-assume-role.yml@common"
3131
parameters:
3232
role: "auto-ops"
@@ -67,10 +67,10 @@ steps:
6767
cd ../terraform
6868
6969
make init
70-
make apply aws_account_no=${aws_account_no} environment=$workspace
70+
make apply aws_account_no=${aws_account_no} environment=$workspace
7171
7272
fi
73-
displayName: Deploy sandbox
73+
displayName: Apply Terraform
7474
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)"
7575
retryCountOnTaskFailure: 2
7676
@@ -93,9 +93,9 @@ steps:
9393
then
9494
echo "Int tests to be set as of now"
9595
fi
96-
echo $marker
96+
echo $marker
9797
poetry run pytest -v -m "$marker" --api-name=immunisation-fhir-api --proxy-name=$PROXY_NAME -o junit_logging=all --junitxml=test-report.xml
98-
98+
9999
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/tests"
100100
displayName: Run full test suite
101101
File renamed without changes.

backend/__init__.py

Whitespace-only changes.

backend/batch_processing_lambda/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)