forked from gitleaks/gitleaks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 1.11 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
.PHONY: test test-cover build release-builds
VERSION := `git fetch --tags && git tag | sort -V | tail -1`
PKG=github.com/zricethezav/gitleaks-ng
LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks-ng/version.Version=$(VERSION)"
COVER=--cover --coverprofile=cover.out
test-cover:
go test ./... --race $(COVER) $(PKG) -v
go tool cover -html=cover.out
test:
go get golang.org/x/lint/golint
go fmt
golint
go test ./... --race $(PKG) -v
test-integration:
go test github.com/zricethezav/gitleaks-ng/hosts -v -integration
build:
go mod tidy
go build $(LDFLAGS)
release-builds:
rm -rf build
mkdir build
env GOOS="windows" GOARCH="amd64" go build -o "build/gitleaks-windows-amd64.exe"
env GOOS="windows" GOARCH="386" go build -o "build/gitleaks-windows-386.exe"
env GOOS="linux" GOARCH="amd64" go build -o "build/gitleaks-linux-amd64"
env GOOS="linux" GOARCH="arm" go build -o "build/gitleaks-linux-arm"
env GOOS="linux" GOARCH="mips" go build -o "build/gitleaks-linux-mips"
env GOOS="linux" GOARCH="mips" go build -o "build/gitleaks-linux-mips"
env GOOS="darwin" GOARCH="amd64" go build -o "build/gitleaks-darwin-amd64"