Skip to content

Commit

Permalink
Update deploy workflow and Makefile
Browse files Browse the repository at this point in the history
Why these changes are being introduced:
Deployment of lambda functions requires updating the function code in
addition to pushing the container to ECR.

How this addresses that need:
* Adds update-lambda-function command to the dev_ecr_push workflow
* Updates the Makefile to use a generic name for the update lambda
  function (previously had a copy/pasted name specific to another repo)

Side effects of this change:
* All future pushes to `main` will update the lambda function code
  after pushing the new container

Relevant tickets:
* https://mitlibraries.atlassian.net/browse/ENSY-77
  • Loading branch information
hakbailey committed May 18, 2022
1 parent d76bce4 commit be764c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/dev_ecr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v2
- name: Configure AWS credentials
Expand All @@ -34,3 +34,5 @@ jobs:
run: make dist-dev
- name: Push image
run: make publish-dev
- name: Update lambda function
run: make update-lambda-dev
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ publish-dev: dist-dev ## Build, tag and push
docker push $(ECR_REGISTRY_DEV)/alma-webhook-lambdas-dev:latest
docker push $(ECR_REGISTRY_DEV)/alma-webhook-lambdas-dev:`git describe --always`

update-format-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr
update-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr
aws lambda update-function-code \
--function-name alma-webhook-dev \
--function-name alma-webhook-lambdas-dev \
--image-uri $(shell aws sts get-caller-identity --query Account --output text).dkr.ecr.us-east-1.amazonaws.com/alma-webhook-lambdas-dev:latest

0 comments on commit be764c6

Please sign in to comment.