forked from theburningmonk/lambda-platform-perf-comparison
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathshared.mk
executable file
·51 lines (38 loc) · 1.15 KB
/
shared.mk
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
49
50
51
BUILDER=docker-compose -f ../docker-compose.yml run --rm $(RUNTIME)
SLS=docker-compose -f ../docker-compose.yml run --rm -w /opt/app/gcp/$(RUNTIME) --entrypoint sls sls
SLS_BASH=docker-compose -f ../docker-compose.yml run --rm -w /opt/app/gcp/$(RUNTIME) sls
ARTILLERY=docker-compose -f ../docker-compose.yml run --rm -e API_URL=$(API_URL) artillery
ARTILLERY_BASH=docker-compose -f ../docker-compose.yml run --rm -e API_URL=$(API_URL) --entrypoint bash artillery
# Builder
all: clean package deploy
clean: ../.env
$(BUILDER) make _clean
build: ../.env
$(BUILDER) make _build
# Serverless
package: ../.env build
$(SLS) package
deploy: ../.env
if [ -d .serverless ]; then \
$(SLS) deploy --package .serverless; \
else \
$(SLS) deploy; \
fi
plugins: ../.env
$(SLS_BASH) npm install --ignore-scripts
remove: ../.env
$(SLS) remove
# Artillery
baseLine: ../.env
$(ARTILLERY) run --output reports/$(RUNTIME).json runtime_baseline.yml
report: ../.env
$(ARTILLERY) report reports/$(RUNTIME).json
# Helpers
../.env:
cp ../.env.template ../.env
shellBuilder: ../.env
$(BUILDER) bash
shellSls: ../.env
$(SLS_BASH) bash
shellArtillery: ../.env
$(ARTILLERY_BASH)