From 5e018d957ffbf8ebe94e9b75430bdb8e2173de24 Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Wed, 6 Nov 2024 17:16:59 +0000 Subject: [PATCH 1/2] Fix management handler path --- democracy_club/{lambda_mange.py => lambda_manage.py} | 0 sam-template.yaml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename democracy_club/{lambda_mange.py => lambda_manage.py} (100%) diff --git a/democracy_club/lambda_mange.py b/democracy_club/lambda_manage.py similarity index 100% rename from democracy_club/lambda_mange.py rename to democracy_club/lambda_manage.py diff --git a/sam-template.yaml b/sam-template.yaml index 3e1ef8a9..898c111c 100644 --- a/sam-template.yaml +++ b/sam-template.yaml @@ -136,7 +136,7 @@ Resources: Timeout: 60 Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/DCWebsiteLambdaExecutionRole" CodeUri: . - Handler: democracy_club.lambda_wsgi.management_handler + Handler: democracy_club.lambda_manage.management_handler Layers: - !Ref DependenciesLayer Runtime: python3.12 From 5d66f26b725161ff5aa1246084a5f90bd1bb02c4 Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Wed, 6 Nov 2024 17:40:48 +0000 Subject: [PATCH 2/2] Fail if 'FunctionError' exists in the JSON output --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 442b085e..efb22b11 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,7 +119,7 @@ jobs: # the command will exit 0 even if the invocation failed. The JSON key `FunctionError` will contain something # if there's an error. command: | - aws lambda invoke --function-name DCWebsiteManagementFunction --payload '{ "command": "migrate", "args": ["--no-input"] }' --cli-binary-format raw-in-base64-out - | grep 'FunctionError": ""' + aws lambda invoke --function-name DCWebsiteManagementFunction --payload '{ "command": "migrate", "args": ["--no-input"] }' --cli-binary-format raw-in-base64-out - | grep -v 'FunctionError' - run: name: "Invalidate CloudFront cache" command: |