From 6ac20fa98f0fe99dbebb07f3948b1a0d2ebab2ab Mon Sep 17 00:00:00 2001 From: Abid Khan Date: Fri, 29 Nov 2024 10:12:24 +0600 Subject: [PATCH] zip with packaging added to create lambda function in deployment shell script --- deployment/awslocal/deploy.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/deployment/awslocal/deploy.sh b/deployment/awslocal/deploy.sh index d4eb22d..b31566b 100755 --- a/deployment/awslocal/deploy.sh +++ b/deployment/awslocal/deploy.sh @@ -14,6 +14,7 @@ awslocal sns subscribe \ --protocol email \ --notification-endpoint my-email@example.com +(cd lambdas/presign; rm -f lambda.zip; zip lambda.zip handler.py) awslocal lambda create-function \ --function-name presign \ --runtime python3.11 \ @@ -29,6 +30,7 @@ awslocal lambda create-function-url-config \ --function-name presign \ --auth-type NONE +(cd lambdas/list; rm -f lambda.zip; zip lambda.zip handler.py) awslocal lambda create-function \ --function-name list \ --runtime python3.11 \ @@ -44,7 +46,15 @@ awslocal lambda create-function-url-config \ --function-name list \ --auth-type NONE - +( + cd lambdas/resize + rm -rf package lambda.zip + mkdir package + pip install -r requirements.txt -t package --platform manylinux2014_x86_64 --only-binary=:all: + zip lambda.zip handler.py + cd package + zip -r ../lambda.zip *; +) awslocal lambda create-function \ --function-name resize \ --runtime python3.11 \