-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
43 lines (32 loc) · 1.59 KB
/
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
39
40
41
42
43
SRCDIR = docs/diagrams
OUTPUT_FORMAT = png
SRC = $(wildcard $(SRCDIR)/*.mdd)
OUT = ${SRC:.mdd=.$(OUTPUT_FORMAT)}
DETACHED ?= false
BUILD ?= false
export FLAGS
help: Makefile ## show list of commands
@echo "Choose a command run:"
@echo ""
@awk 'BEGIN {FS = ":.*?## "} /[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
ifeq ($(DETACHED),true)
FLAGS+= --detach
endif
ifeq ($(BUILD),true)
FLAGS+= --build
endif
generate-diagrams: $(OUT)
$(SRCDIR)/%.$(OUTPUT_FORMAT): $(SRCDIR)/%.mdd
npm run generate-diagram -- --input $< --output $@
run/pokeshop: ## run Pokeshop API on docker compose
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml up ${FLAGS}
down/pokeshop: ## stop Pokeshop API running on docker compose
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml down
run/tracetests: ## run Trace-based tests on Pokeshop API with Tracetest
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml run tracebased-tests
run: ## run Pokeshop API on Docker Compose and run Trace-based tests with Tracetest
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml up ${FLAGS}
down: ## stop Pokeshop API on Docker Compose and run Trace-based tests with Tracetest
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml down
build/docker: # build docker image locally
docker build . -t kubeshop/demo-pokemon-api:latest