Makefile 1.0 KB

123456789101112131415161718192021222324252627
  1. .PHONY: test build-all deploy
  2. test:
  3. go get github.com/golang/lint/golint
  4. go fmt
  5. golint
  6. go test --race --cover -run=Test$
  7. deploy:
  8. @echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
  9. docker build -f Dockerfile -t $(REPO):$(TAG) .
  10. echo "Pushing $(REPO):$(COMMIT) $(REPO):$(TAG)"
  11. docker push $(REPO)
  12. build-all:
  13. rm -rf build
  14. mkdir build
  15. env GOOS="windows" GOARCH="amd64" go build -o "build/gitleaks-windows-amd64.exe"
  16. env GOOS="windows" GOARCH="386" go build -o "build/gitleaks-windows-386.exe"
  17. env GOOS="linux" GOARCH="amd64" go build -o "build/gitleaks-linux-amd64"
  18. env GOOS="linux" GOARCH="arm" go build -o "build/gitleaks-linux-arm"
  19. env GOOS="linux" GOARCH="mips" go build -o "build/gitleaks-linux-mips"
  20. env GOOS="linux" GOARCH="mips" go build -o "build/gitleaks-linux-mips"
  21. env GOOS="darwin" GOARCH="amd64" go build -o "build/gitleaks-darwin-amd64"
  22. benchmark:
  23. go test -run=Benchmark -bench=. -benchtime=5s
  24. benchmark-fast:
  25. go test -bench=BenchmarkAuditLeakRepo -run=BenchmarkAuditLeakRepo$