Skip to content

Commit

Permalink
WIP: Use samlocal instead of building own ZIP file
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-dxw committed Oct 9, 2023
1 parent a85cd0b commit ef912b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
build:
@mkdir -p dist
@STATIC_DEPS=true python3 -m pip install -t package -r requirements/base.txt
@rm dist/lambda.zip & 2>&1
@cd package && zip -r ../dist/lambda.zip * && cd ..
@zip -g dist/lambda.zip ds-caselaw-ingester/lambda_function.py
@echo 'Built dist/lambda.zip'
samlocal build --use-container -m requirements/base.txt

ifeq (setup,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "setup"
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-localstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ awslocal sns create-topic \
awslocal sns subscribe \
--topic-arn arn:aws:sns:us-east-1:000000000000:judgments \
--protocol lambda \
--notification-endpoint arn:aws:lambda:us-east-1:000000000000:function:te-lambda
--notification-endpoint arn:aws:lambda:eu-west-2:000000000000:function:ds-caselaw-ingester-TNACaselawIngesterFuncti-b824e251

awslocal s3api create-bucket \
--bucket te-editorial-out-int
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-lambda.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source .env

awslocal lambda update-function-code --function-name te-lambda --zip-file fileb://dist/lambda.zip
samlocal deploy --no-confirm-changeset --no-fail-on-empty-changeset --stack-name ds-caselaw-ingester --resolve-s3 --capabilities CAPABILITY_IAM --region us-east-1

awslocal lambda update-function-configuration --function-name te-lambda \
awslocal lambda update-function-configuration --function-name te-lambda --region=us-east-1 \
--environment "Variables={MARKLOGIC_HOST=$MARKLOGIC_HOST,MARKLOGIC_USER=$MARKLOGIC_USER,MARKLOGIC_PASSWORD=$MARKLOGIC_PASSWORD,AWS_BUCKET_NAME=$AWS_BUCKET_NAME,AWS_SECRET_KEY=$AWS_SECRET_KEY,AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID,AWS_ENDPOINT_URL=$AWS_ENDPOINT_URL,SQS_QUEUE_URL=$SQS_QUEUE_URL,ROLLBAR_TOKEN=$ROLLBAR_TOKEN,ROLLBAR_ENV=$ROLLBAR_ENV,NOTIFY_API_KEY=$NOTIFY_API_KEY,NOTIFY_EDITORIAL_ADDRESS=$NOTIFY_EDITORIAL_ADDRESS,NOTIFY_NEW_JUDGMENT_TEMPLATE_ID=$NOTIFY_NEW_JUDGMENT_TEMPLATE_ID,EDITORIAL_UI_BASE_URL=$EDITORIAL_UI_BASE_URL,PUBLIC_ASSET_BUCKET=$PUBLIC_ASSET_BUCKET}"

0 comments on commit ef912b8

Please sign in to comment.