diff --git a/Makefile b/Makefile index 8789b4e..3e46a99 100644 --- a/Makefile +++ b/Makefile @@ -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" diff --git a/scripts/setup-localstack.sh b/scripts/setup-localstack.sh index 0dd0322..0437031 100755 --- a/scripts/setup-localstack.sh +++ b/scripts/setup-localstack.sh @@ -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 diff --git a/scripts/update-lambda.sh b/scripts/update-lambda.sh index b6eabe8..627c2ee 100755 --- a/scripts/update-lambda.sh +++ b/scripts/update-lambda.sh @@ -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}"