@@ -5,7 +5,7 @@ VERSION := "$(shell git describe --tags ${TAG})-next"
55BUILD_DIR =dist
66PROTON_COMMIT := "409f146"
77
8- .PHONY : all build clean test tidy vet proto setup format generat
8+ .PHONY : all build clean test tidy vet proto setup format generate lint install
99
1010all : clean test build format lint
1111
@@ -14,22 +14,22 @@ tidy:
1414 @go mod tidy -v
1515
1616install :
17- @echo " Installing Guardian to ${GOBIN} ..."
17+ @echo " Installing compass to ${GOBIN} ..."
1818 @go install
1919
2020format :
2121 @echo " Running go fmt..."
22- @go fmt
22+ @go fmt ./...
2323
2424lint : # # Lint checker
2525 @echo " Running lint checks using golangci-lint..."
2626 @golangci-lint run
2727
28- clean : tidy # # Clean the build artifacts
28+ clean : # # Clean the build artifacts
2929 @echo " Cleaning up build directories..."
30- @rm -rf $ coverage .out ${BUILD_DIR}
30+ @rm -rf coverage.out ${BUILD_DIR}
3131
32- test : # # Run the tests
32+ test : # # Run the tests
3333 go test ./... -race -coverprofile=coverage.out
3434
3535e2e : # # Run all e2e tests
@@ -40,21 +40,19 @@ coverage: test ## Print the code coverage
4040 @go tool cover -html=coverage.out
4141
4242build : # # Build the compass binary
43- @echo " Building guardian version ${VERSION} ..."
43+ @echo " Building compass version ${VERSION} ..."
4444 CGO_ENABLED=0 go build -ldflags " -X ${NAME} /cli.Version=${VERSION} "
4545 @echo " Build complete"
4646
47- buildr : setup
48- goreleaser --snapshot --skip- publish --rm-dist
47+ buildr : setup # # Build release snapshot
48+ goreleaser release --snapshot --skip= publish --clean
4949
50-
51- vet :
50+ vet : # # Run go vet
5251 go vet ./...
5352
54- download :
53+ download : # # Download go modules
5554 @go mod download
5655
57-
5856generate : # # Run all go generate in the code base
5957 @echo " Running go generate..."
6058 go generate ./...
@@ -63,20 +61,17 @@ config: ## Generate the sample config file
6361 @echo " Initializing sample server config..."
6462 @cp config/config.yaml config.yaml
6563
66-
6764proto : # # Generate the protobuf files
6865 @echo " Generating protobuf from raystack/proton"
69- @echo " [info] make sure correct version of dependencies are installed using 'make install '"
66+ @echo " [info] make sure correct version of dependencies are installed using 'make setup '"
7067 @buf generate https://github.com/raystack/proton/archive/${PROTON_COMMIT} .zip#strip_components=1 --template buf.gen.yaml --path raystack/compass -v
7168 @echo " Protobuf compilation finished"
7269
7370setup : # # Install required dependencies
7471 @echo " > Installing dependencies..."
7572 go mod tidy
76- go install github.com/vektra/mockery/v2@v2.14.0
77- go install google.golang.org/protobuf/proto@v1.28.0
78- go install google.golang.org/grpc@v1.46.0
79- go install github.com/bufbuild/buf/cmd/buf@v1.4.0
73+ go install github.com/vektra/mockery/v2@latest
74+ go install github.com/bufbuild/buf/cmd/buf@latest
8075
8176swagger-md :
8277 npx swagger-markdown -i proto/compass.swagger.yaml -o docs/docs/reference/api.md
@@ -86,9 +81,9 @@ clean-doc:
8681 @rm -rf ./docs/docs/reference/cli.md
8782 @rm -f ./docs/docs/reference/api.md
8883
89- doc : clean-doc update- swagger-md # # Generate api and cli references
84+ doc : clean-doc swagger-md # # Generate api and cli references
9085 @echo " > generate cli docs"
9186 @go run . reference --plain | sed ' 1 s,.*,# CLI,' > ./docs/docs/reference/cli.md
92-
87+
9388help : # # Display this help message
9489 @cat $(MAKEFILE_LIST ) | grep -e " ^[a-zA-Z_\-]*: *.*## *" | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
0 commit comments