schnutibox/Makefile

59 lines
1.3 KiB
Makefile
Raw Normal View History

2021-03-30 19:59:26 +02:00
.PHONY: build
build:
goreleaser build --rm-dist --snapshot
.PHONY: release
release:
goreleaser release --rm-dist --snapshot --skip-publish
.PHONY: generate
generate:
go generate
.PHONY: lint
lint:
2021-04-16 09:34:22 +02:00
golangci-lint run --timeout 10m --enable-all --disable=exhaustivestruct
2021-03-30 19:59:26 +02:00
.PHONY: test
test:
go test -v -race -cover ./...
.PHONY: test-integration
test-integration: release
go test -v -tags=integration -timeout=120m
2021-03-30 19:59:26 +02:00
.PHONY: readme
readme:
goreadme -title revive > README.md
.PHONY: tidy
tidy:
go mod tidy
go mod vendor
.PHONY: build-image
build-image:
sudo ./scripts/build.sh
2021-05-04 08:41:43 +02:00
.PHONY: install-tools
install-tools:
go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
2021-05-05 08:32:35 +02:00
.PHONY: protoc-gen
protoc-gen:
protoc \
--proto_path=api/proto/v1 \
--go_opt=paths=source_relative \
--go-grpc_opt=paths=source_relative \
--go-grpc_out=pkg/api/v1 \
--go_out=pkg/api/v1 \
--grpc-gateway_opt=logtostderr=true \
--grpc-gateway_opt=paths=source_relative \
--grpc-gateway_opt=generate_unbound_methods=true \
--grpc-gateway_out=pkg/api/v1 \
api/proto/v1/schnutibox.proto