2020-06-06 18:49:04 +01:00
|
|
|
VERSION := $(shell git describe --always --long --dirty --tags)
|
|
|
|
|
|
|
|
build:
|
2020-07-06 17:10:14 +01:00
|
|
|
@echo Running no-output build
|
2020-06-06 18:52:02 +01:00
|
|
|
go mod download
|
2020-07-10 18:57:57 +01:00
|
|
|
go build -ldflags="-X 'github.com/mdiluz/rove/cmd/version.Version=${VERSION}'" ./...
|
2020-06-06 18:49:04 +01:00
|
|
|
|
|
|
|
install:
|
2020-07-06 17:10:14 +01:00
|
|
|
@echo Installing to GOPATH
|
2020-06-06 18:52:02 +01:00
|
|
|
go mod download
|
2020-06-06 18:49:04 +01:00
|
|
|
go install -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=${VERSION}'" ./...
|
|
|
|
|
2020-06-10 23:23:09 +01:00
|
|
|
gen:
|
2020-07-07 12:59:10 +01:00
|
|
|
@echo Installing go dependencies
|
2020-07-10 19:00:31 +01:00
|
|
|
go install github.com/golang/protobuf/protoc-gen-go
|
2020-07-07 12:59:10 +01:00
|
|
|
go mod download
|
2020-07-10 19:00:31 +01:00
|
|
|
@echo Generating rove server gRPC
|
|
|
|
protoc --proto_path proto --go_out=plugins=grpc,paths=source_relative:proto/ proto/roveapi/roveapi.proto
|
2020-06-10 23:23:09 +01:00
|
|
|
|
2020-06-06 18:49:25 +01:00
|
|
|
test:
|
2020-06-11 20:25:03 +01:00
|
|
|
@echo Unit tests
|
|
|
|
go test -v ./...
|
|
|
|
|
|
|
|
@echo Integration tests
|
2020-06-11 18:55:53 +01:00
|
|
|
docker-compose up --build --exit-code-from=rove-tests --abort-on-container-exit rove-tests
|
2020-06-13 12:35:37 +01:00
|
|
|
docker-compose down
|
2020-06-11 18:55:53 +01:00
|
|
|
go tool cover -html=/tmp/coverage-data/c.out -o /tmp/coverage.html
|
2020-06-11 20:25:03 +01:00
|
|
|
|
2020-06-11 18:55:53 +01:00
|
|
|
@echo Done, coverage data can be found in /tmp/coverage.html
|
2020-06-07 23:20:39 +01:00
|
|
|
|
2020-06-11 18:55:53 +01:00
|
|
|
.PHONY: build install test gen
|