-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (32 loc) · 1.18 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
PROJECT_PKGS := $$(go list -mod vendor ./... | grep -v /vendor/)
lint:
golangci-lint run
test:
echo "mode: count" > coverage-all.out
for pkg in $(PROJECT_PKGS); do \
GO111MODULE=on go test -mod vendor -coverprofile=coverage.out -covermode=count -v $$pkg || exit 1 ;\
if [ -f coverage.out ]; then \
tail -n +2 coverage.out >> coverage-all.out ;\
rm coverage.out ;\
fi; \
done
go tool cover -func=coverage-all.out
rm coverage-all.out
functional-test-amqp: cleanup-docker
tests/functional_test_amqp.sh
functional-test-redis: cleanup-docker
tests/functional_test_redis.sh
functional-test-sla: cleanup-docker
tests/functional_test_sla.sh
cleanup-docker:
docker-compose stop
docker-compose rm -f
build:
mkdir -p build
GO111MODULE=on CGO_ENABLED=1 GOOS=linux go build -mod vendor -tags netgo -installsuffix cgo -o build/loggo/loggo cmd/loggo/main.go
build-validating-webhook:
mkdir -p build
GO111MODULE=on CGO_ENABLED=1 GOOS=linux go build -mod vendor -tags netgo -installsuffix cgo -o build/validating-webhook/validating-webhook cmd/validating-webhook/main.go
build-test:
GO111MODULE=on go build -mod vendor -o build/tests cmd/tests/main.go
.PHONY: build test functional-test lint