-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (33 loc) · 1023 Bytes
/
Makefile
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
QUIET := true
.PHONY: package
package: clean
@echo "=== Building new package in the Docker container"
ifeq ($(QUIET),true)
@docker build -q -t pck -f Dockerfile.package . && docker run -it --rm -v $(PWD)/package:/package pck /bin/bash -c "zip -q -r9 /package/app.zip ."
else
@docker build -t pck -f Dockerfile.package . && docker run -it --rm -v $(PWD)/package:/package pck /bin/bash -c "zip -r9 /package/app.zip ."
endif
clean:
@echo "=== Cleaning old package"
@rm -rf package
deploy: package
ifdef ENVIRONMENT
@echo "=== Deploying lambda function"
sls deploy -v -s ${ENVIRONMENT}
else
@echo "\nERROR: please define ENVIRONMENT variable"
endif
invoke: deploy
ifdef ENVIRONMENT
@echo "=== Invoking lambda function"
sls invoke -f main -l -s ${ENVIRONMENT}
else
@echo "\nERROR: please define ENVIRONMENT variable"
endif
local:
ifdef ENVIRONMENT
@echo "=== Invoking lambda function locally"
sls invoke local -f main --stage ${ENVIRONMENT}
else
@echo "\nERROR: please define ENVIRONMENT variable"
endif