Skip to content

Commit

Permalink
Merge pull request #185 from MaxRenaud/mrbranch
Browse files Browse the repository at this point in the history
Improve Makefile and README.md for new users
  • Loading branch information
k8s-ci-robot committed Mar 25, 2021
2 parents a04e564 + 3d8ebcb commit 63f2c4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,31 @@ lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(INSTALL_LOCATION) v$(GOLANGCI_LINT_VERSION)
$(INSTALL_LOCATION)/golangci-lint run --no-config --disable-all --enable=gofmt,golint,gosec --fix --verbose --timeout 3m

## --------------------------------------
## Go
## --------------------------------------

.PHONY: mod-download
mod-download:
go mod download

## --------------------------------------
## Proto
## --------------------------------------

.PHONY: gen
gen: proto/agent/agent.pb.go konnectivity-client/proto/client/client.pb.go mock_gen
gen: mod-download proto/agent/agent.pb.go konnectivity-client/proto/client/client.pb.go mock_gen

konnectivity-client/proto/client/client.pb.go: konnectivity-client/proto/client/client.proto
mkdir -p ${GOPATH}/src
protoc -I . konnectivity-client/proto/client/client.proto --go_out=plugins=grpc:${GOPATH}/src
cat hack/go-license-header.txt konnectivity-client/proto/client/client.pb.go > konnectivity-client/proto/client/client.licensed.go
cat hack/go-license-header.txt ${GOPATH}/src/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.pb.go > konnectivity-client/proto/client/client.licensed.go
mv konnectivity-client/proto/client/client.licensed.go konnectivity-client/proto/client/client.pb.go

proto/agent/agent.pb.go: proto/agent/agent.proto
mkdir -p ${GOPATH}/src
protoc -I . proto/agent/agent.proto --go_out=plugins=grpc:${GOPATH}/src
cat hack/go-license-header.txt proto/agent/agent.pb.go > proto/agent/agent.licensed.go
cat hack/go-license-header.txt ${GOPATH}/src/sigs.k8s.io/apiserver-network-proxy/proto/agent/agent.pb.go > proto/agent/agent.licensed.go
mv proto/agent/agent.licensed.go proto/agent/agent.pb.go

## --------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ For image builds these determine the location of your image.
For GCE the registry should be gcr.io and PROJECT_ID should be the project you
want to use the images in.

### Mockgen

The [```mockgen```](https://github.com/golang/mock) tool must be installed on your system.

### Protoc

Proto definitions are compiled with `protoc`. Please ensure you have protoc installed ([Instructions](https://grpc.io/docs/protoc-installation/)) and the `proto-gen-go` library at the appropriate version.
Expand Down

0 comments on commit 63f2c4d

Please sign in to comment.