Giter VIP home page Giter VIP logo

prototool-docker's Introduction

Prototool Docker Helper

Docker Automated build

Docker image with prototool, gogoproto, protoc-gen-validate, grpc-gateway, grpc-web and protoc-gen-grpc-java pre-installed.

The accompanying prototool.sh script mounts the current working directory as /work and runs the Docker image as the current user. This results in the generated artifacts having the correct permissions.

Installation

curl -o prototool.sh https://raw.githubusercontent.com/charithe/prototool-docker/v0.1.0/prototool.sh

Optionally, add prototool.sh to your PATH.

Usage

See example for a full example.

Create a prototool.yaml file in your project root as usual. For example:

protoc:
  version: 3.7.1
  includes:
    - /usr/include

lint:
  rules:
    remove:
      - FILE_OPTIONS_EQUAL_JAVA_PACKAGE_COM_PREFIX

generate:
  go_options:
    import_path: github.com/charithe/telemetry

  plugins:
    - name: gogofast
      type: gogo
      flags: plugins=grpc
      output: ./go/pkg/gen
    - name: validate
      flags: lang=go
      output: ./go/pkg/gen
    - name: java
      output: ./java/src/main/java
    - name: grpc-java
      output: ./java/src/main/java

Prototool can now be invoked as follows:

# Lint
./prototool.sh lint

# Compile
./prototool.sh compile

# All
./prototool.sh all

Cache

To avoid constant downloading of protoc everytime we run prototool from this image (which is about 10MB and slow if you are not on a good connection), we cache some recent versions of protoc while building the image. If you use one of the following in your project-specific prototool.yaml file, it will be read from the cache. If you wish to add more versions, please update the Dockerfile accordingly.

  • protoc 3.7.1
  • protoc 3.8.0

prototool-docker's People

Contributors

ethanfrey avatar charithe avatar ruseinov avatar

Stargazers

Orkun Külçe avatar

Watchers

Romeo 49 avatar James Cloos avatar  avatar

Forkers

ruseinov orkunkl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.