-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fetch protos with commit ref (#84)
* ci: update makefile * ci: update makefile * chore: update proton commit * refactor: fix service name in comments Co-authored-by: Abhishek Sah <abhi.sah.97@gmail.com>
- Loading branch information
1 parent
a63901d
commit e7ff2d0
Showing
8 changed files
with
3,169 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,6 @@ bin/air | |
tmp | ||
dist/ | ||
siren | ||
!siren/ | ||
!siren/ | ||
|
||
third_party/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,45 @@ | ||
NAME="github.com/odpf/siren" | ||
VERSION=$(shell git describe --always --tags 2>/dev/null) | ||
COVERFILE="/tmp/siren.coverprofile" | ||
LAST_COMMIT := $(shell git rev-parse --short HEAD) | ||
LAST_TAG := "$(shell git rev-list --tags --max-count=1)" | ||
APP_VERSION := "$(shell git describe --tags ${LAST_TAG})-next" | ||
PROTON_COMMIT := "ef83b9e9248e064a1c366da4fe07b3068266fe59" | ||
|
||
.PHONY: all build clean | ||
.PHONY: all build test clean dist vet proto install | ||
|
||
all: build | ||
|
||
build: | ||
go build -ldflags "-X main.Version=${VERSION}" ${NAME} | ||
build: ## Build the siren binary | ||
@echo " > building siren version ${APP_VERSION}" | ||
go build -ldflags "-X main.Version=${APP_VERSION}" ${NAME} | ||
@echo " - build complete" | ||
|
||
clean: | ||
rm -rf siren dist/ | ||
|
||
test: | ||
test: ## Run the tests | ||
go test ./... -coverprofile=coverage.out | ||
|
||
test-coverage: test | ||
go tool cover -html=coverage.out | ||
|
||
dist: | ||
@bash ./scripts/build.sh | ||
|
||
check-swagger: | ||
which swagger || (GO111MODULE=off go get -u github.com/go-swagger/go-swagger/cmd/swagger) | ||
|
||
swagger: check-swagger | ||
GO111MODULE=on go mod vendor && swagger generate spec -o ./api/handlers/swagger.yaml --scan-models | ||
coverage: ## Print code coverage | ||
go test -race -coverprofile coverage.txt -covermode=atomic ./... & go tool cover -html=coverage.out | ||
|
||
swagger-serve: check-swagger | ||
swagger serve -F=swagger api/handlers/swagger.yaml | ||
|
||
generate-proto: ## regenerate protos | ||
proto: ## Generate the protobuf files | ||
@echo " > generating protobuf from odpf/proton" | ||
@buf generate --template buf.gen.yaml https://github.com/odpf/proton.git --path odpf/siren | ||
@echo " > [info] make sure correct version of dependencies are installed using 'make install'" | ||
@buf generate https://github.com/odpf/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path odpf/siren | ||
@echo " > protobuf compilation finished" | ||
|
||
clean: ## Clean the build artifacts | ||
rm -rf siren dist/ | ||
|
||
install: ## install required dependencies | ||
@echo "> installing dependencies" | ||
go mod tidy | ||
go get -d google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1 | ||
go get github.com/golang/protobuf/proto@v1.5.2 | ||
go get -d github.com/golang/protobuf/protoc-gen-go@v1.5.2 | ||
go get google.golang.org/grpc@v1.40.0 | ||
go get -d google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0 | ||
go get -d github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.5.0 | ||
go get -d github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.5.0 | ||
go get -d github.com/bufbuild/buf/cmd/buf@v0.54.1 | ||
go get github.com/envoyproxy/protoc-gen-validate | ||
|
||
help: ## Display this help message | ||
@cat $(MAKEFILE_LIST) | grep -e "^[a-zA-Z_\-]*: *.*## *" | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.