-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (47 loc) · 1.7 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
56
57
58
59
60
61
62
63
64
65
export majorVersion=1
export minorVersion=0
export gittip=$(shell git log --format='%h' -n 1)
export patchVersion=$(shell git log --format='%h' | wc -l)
export ver=$(majorVersion).$(minorVersion).$(patchVersion).$(gittip)
include make/*.mk
tools:
@which podman
@podman version
@which redis-cli
@redis-cli --version
@which go
@go version
# https://go.dev/blog/govulncheck
# install it by `go install golang.org/x/vuln/cmd/govulncheck@latest`
vuln:
which govulncheck
govulncheck ./...
deps:
go mod download
go mod verify
go mod tidy
test:
go test -v ./...
run: start
build: deps
CGO_ENABLED=0 go build -ldflags "-X main.Version=$(ver)" -o build/dashboard main.go
build/linux_amd64: deps
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=$(ver)" -o build/dashboard_linux_amd64 main.go
build/linux_arm6: deps
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-X main.Version=$(ver)" -o build/dashboard_linux_arm6 main.go
build/linux_arm7: deps
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-X main.Version=$(ver)" -o build/dashboard_linux_arm7 main.go
build/windows: deps
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-X main.Version=$(ver)" -o build/dashboard.exe main.go
build/macos: deps
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.Version=$(ver)" -o build/dashboard_darwin_amd64 main.go
build/all: build/linux_amd64 build/linux_arm6 build/linux_arm7 build/windows build/macos
md5sum build/dashboard* > build/dashboard.md5
ls -hl build/
start:
go run main.go ./contrib/dashboard.yaml
binary: build
./build/dashboard contrib/dashboard.yaml
tag:
git tag "v$(majorVersion).$(minorVersion).$(patchVersion)"
.PHONY: build