-
Notifications
You must be signed in to change notification settings - Fork 136
/
Makefile
30 lines (22 loc) · 1.01 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
NAME := prometheus-kafka-adapter
PACKAGE_NAME := github.com/Telefonica/prometheus-kafka-adapter
GO_VER := 1.22.3
LIBC_GO_VER := $(GO_VER)-bullseye
MUSL_GO_VER := $(GO_VER)-alpine
all: fmt test build
fmt:
docker run --rm -v $(CURDIR):/app:z -w /app golang:$(MUSL_GO_VER) gofmt -l -w -s *.go
test:
docker run --rm -v $(CURDIR):/app:z -w /app golang:$(MUSL_GO_VER) sh tools/testscript.sh vet
docker run --rm -v $(CURDIR):/app:z -w /app golang:$(MUSL_GO_VER) sh tools/testscript.sh test
build: build-libc build-musl build-docker-image
build-libc:
docker run --rm -v $(CURDIR):/app:z -w /app golang:$(LIBC_GO_VER) sh tools/buildscript.sh $(NAME)
build-musl:
docker run --rm -v $(CURDIR):/app:z -w /app golang:$(MUSL_GO_VER) sh tools/buildscript.sh $(NAME)
build-docker-image:
docker buildx build -t telefonica/prometheus-kafka-adapter:latest .
vendor-update:
docker run --rm -e PACKAGE_NAME=$(PACKAGE_NAME) -v $(CURDIR):/app:z -w /app golang:$(MUSL_GO_VER) sh tools/vendorscript.sh
clean:
rm -f $(NAME)-libc $(NAME)-musl