Browse Source

proto: use docker to generate stubs (#4615)

* proto: use docker to generate stubs

- provide an option to developers to use docker to generate proto stubs

closes #4579

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
pull/4616/head
Marko 4 years ago
committed by GitHub
parent
commit
f5651d2b61
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions
  1. +2
    -1
      CHANGELOG_PENDING.md
  2. +4
    -1
      CONTRIBUTING.md
  3. +5
    -0
      Makefile

+ 2
- 1
CHANGELOG_PENDING.md View File

@ -22,7 +22,8 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
- [privval] \#4534 Add `error` as a return value on`GetPubKey()`
- [Docker] \#4569 Default configuration added to docker image (you can still mount your own config the same way) (@greg-szabo)
- [lite2] [\#4562](https://github.com/tendermint/tendermint/pull/4562) Cache headers when using bisection (@cmwaters)
- [all] [\4608](https://github.com/tendermint/tendermint/pull/4608) Give reactors descriptive names when they're initialized
- [all] [\#4608](https://github.com/tendermint/tendermint/pull/4608) Give reactors descriptive names when they're initialized
- [tools] \#4615 Allow developers to use Docker to generate proto stubs, via `make proto-gen-docker`.
### BUG FIXES:


+ 4
- 1
CONTRIBUTING.md View File

@ -105,7 +105,10 @@ We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along
For linting and checking breaking changes, we use [buf](https://buf.build/). If you would like to run linting and check if the changes you have made are breaking then you will need to have docker running locally. Then the linting cmd will be `make proto-lint` and the breaking changes check will be `make proto-check-breaking`.
To generate new stubs based off of your changes you can run `make proto-gen` after installing `protoc` and gogoproto.
There are two ways to generate your proto stubs.
1. Use Docker, pull an image that will generate your proto stubs with no need to install anything. `make proto-gen-docker`
2. Run `make proto-gen` after installing `protoc` and gogoproto.
### Installation Instructions


+ 5
- 0
Makefile View File

@ -54,6 +54,11 @@ proto-gen:
@sh scripts/protocgen.sh
.PHONY: proto-gen
proto-gen-docker:
@echo "Generating Protobuf files"
@docker run -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto sh ./scripts/protocgen.sh
.PHONY: proto-gen-docker
proto-lint:
@$(DOCKER_BUF) check lint --error-format=json
.PHONY: proto-lint


Loading…
Cancel
Save