Makefile 762 B

123456789101112131415161718192021
  1. GO_FILES=`go list ./... | grep -v -E "mock|store|test|fake|cmd|bin|backend|google|logger|proto"`
  2. proto-build:
  3. protoc -I=. --go_out=:./proto/go/ --go_opt=paths=source_relative \
  4. --go-grpc_out=:./proto/go/ --go-grpc_opt=paths=source_relative ./backend/common/*.proto
  5. protoc -I=. --go_out=:./proto/go/ --go_opt=paths=source_relative \
  6. --go-grpc_out=:./proto/go/ --go-grpc_opt=paths=source_relative ./backend/operation/*.proto
  7. ci-test:
  8. go test $(GO_FILES) -coverprofile .cover.txt
  9. go tool cover -func .cover.txt
  10. rm .cover.txt
  11. lint:
  12. golangci-lint run ./...
  13. build:
  14. rm -rf bin
  15. mkdir -p bin
  16. GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o bin/kptTmrGroup -ldflags "-X kpt.kptyun.cn:3000/kpt-event/kpt-tmr-group/pod.appVersion=${version}" main.go