This repository was archived by the owner on Apr 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (33 loc) · 1.19 KB
/
Makefile
File metadata and controls
48 lines (33 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
SRC = $(wildcard lib/*.py)
PKG = lib.zip
FN = $(shell terraform output function_name)
URL1 = $(shell terraform output base_url)
URL2 = $(shell terraform output custom_url)
REGION = $(shell terraform output region)
all: help
clean: ## remove artifacts
-rm lib.zip 2> /dev/null
build: $(PKG) ## build artifacts
verify: build ## validate terraform config
terraform validate
plan: verify ## show deployment plan
terraform plan
deploy: verify ## deploy terraform config
terraform apply --auto-approve
destroy: ## destroy all terraform deployed resources
terraform destroy --auto-approve
validate: deploy ## verify deployment succeeded
aws lambda invoke \
--invocation-type RequestResponse \
--function-name $(FN) \
--region $(REGION) \
--payload '{"name":"john","qwer":"asdr"}' \
--log-type Tail /dev/stdout | jq -r .LogResult | base64 -D
curl $(URL1)
curl -iL $(URL2)
$(PKG): $(SRC) ## build zip package
cd lib; zip -rq9 ../$(PKG) . -i \*.py
help: ## Display help text.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: all clean build verify deploy validate help
# vi:se nowrap: