-
Notifications
You must be signed in to change notification settings - Fork 130
/
Makefile
46 lines (37 loc) · 1.04 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
BUILD := build
GO ?= go
GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*")
GOFMT ?= gofmt
GOIMPORTS ?= goimports -local=github.com/jacksontj/promxy
STATICCHECK ?= staticcheck
.PHONY: clean
clean:
$(GO) clean -i ./...
rm -rf $(BUILD)
.PHONY: static-check
static-check:
$(STATICCHECK) ./...
.PHONY: fmt
fmt:
$(GOFMT) -w -s $(GOFILES)
.PHONY: imports
imports:
$(GOIMPORTS) -w $(GOFILES)
.PHONY: test
test:
GO111MODULE=on $(GO) test -race -mod=vendor -tags netgo,builtinassets ./...
.PHONY: release
release:
./build.bash github.com/jacksontj/promxy/cmd/promxy $(BUILD)
./build.bash github.com/jacksontj/promxy/cmd/remote_write_exporter $(BUILD)
testlocal-build:
docker build -t 127.0.0.1:32000/promxy:latest .
docker push 127.0.0.1:32000/promxy:latest
.PHONY: vendor
vendor:
GO111MODULE=on $(GO) mod tidy -compat=1.20
GO111MODULE=on $(GO) mod vendor
.PHONY: update-prom-fork
update-prom-fork:
GO111MODULE=on $(GO) mod edit -replace github.com/prometheus/prometheus=github.com/jacksontj/[email protected]
$(MAKE) vendor