-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bootstrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
test: | ||
go test ./... | ||
build: # https://docs.aws.amazon.com/lambda/latest/dg/golang-package.html | ||
GOOS=linux GOARCH=arm64 go build -tags lambda.norpc -o bootstrap main.go | ||
zip update-ynab.zip bootstrap | ||
deploy: | ||
function_name="update-ynab-fn" | ||
if aws lambda get-function --function-name $function_name --region us-east-1 &> /dev/null | ||
then | ||
echo "Updating function" | ||
aws lambda update-function-code --function-name $function_name \ | ||
--zip-file fileb://update-ynab.zip | ||
else | ||
echo "Creating function" | ||
aws lambda create-function --function-name $function_name \ | ||
--runtime provided.al2023 \ | ||
--handler bootstrap \ | ||
--architectures arm64 \ | ||
--role $LAMBDA_ROLE_ARN \ | ||
--zip-file fileb://update-ynab.zip | ||
fi |