-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (31 loc) · 880 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
.PHONY: proto images test
# generate proto files
proto:
protoc --go_out=internal \
--go_opt=paths=source_relative \
--go-grpc_out=internal \
--go-grpc_opt=paths=source_relative \
api/*.proto
# build images for docker compose deployment
images:
for dir in cmd/*; do \
if [ -d "$$dir" ]; then \
service=$$(basename $$dir); \
docker build -f cmd/$$service/Dockerfile -t easypwn/$$service .; \
fi \
done
docker build -f web/Dockerfile -t easypwn/web .
# run tests
test:
godotenv -f .env.local go test -v ./... -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
# run tests for a specific package
testpackage:
@if [ -z "$(package)" ]; then \
echo "Usage: make testpackage package=PackageName"; \
exit 1; \
fi
godotenv -f .env.local go test -v ./$(package)
# run server
run:
docker compose --env-file .env.local up --build