forked from etf1/kafka-message-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (40 loc) · 1.27 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
44
45
46
47
48
49
50
51
52
53
54
55
VERSION ?= $(shell git describe --always --abbrev=1 --tags --match "v[0-9]*")
LDFLAGS=-ldflags "-X main.version=${VERSION}"
TMPDIR := $(shell mktemp -d)
dev.up:
docker-compose -p dev up -d kafka
dev.down:
docker-compose -p dev down -v
build:
go build -tags musl -v ./...
builds:
$(MAKE) build
cd clientlib && $(MAKE) build -f ../Makefile
.PHONY: bin
bin:
go build ${LDFLAGS} -tags musl -v -o bin/scheduler ./cmd/kafka
.PHONY: mock
mini:
go build ${LDFLAGS} -tags musl -v -o bin/mini ./cmd/mini
run.mini:
go run ${LDFLAGS} -tags musl -v ./cmd/mini
run:
go run ${LDFLAGS} -tags musl -v ./cmd/kafka
lint:
golangci-lint --build-tags musl run
lints:
$(MAKE) lint
cd clientlib && $(MAKE) lint -f ../Makefile
test:
go test -v -tags musl -failfast -race -count=1 ./... -coverprofile=./coverage/coverage.txt -covermode=atomic
tests: builds lints
$(MAKE) test
# cd clientlib && $(MAKE) test -f ../Makefile
tests.docker:
docker-compose -p testsenv build tests; \
docker-compose -p testsenv up --exit-code-from tests tests; ret=$$?; \
docker-compose -p testsenv down -v; exit $$ret;
docker:
docker build -t etf1/kafka-message-scheduler:${VERSION} -f ./cmd/kafka/Dockerfile .
docker.mini:
docker build -t etf1/kafka-message-scheduler:mini-${VERSION} -f ./cmd/mini/Dockerfile .