Skip to content

Commit

Permalink
chore: style
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Feb 4, 2020
1 parent 1869460 commit 7328188
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ update_examples:


PROTOS_SRC := $(wildcard ./api/*.proto) $(wildcard ./api/internal/*.proto)
GEN_SRC := $(PROTOS_SRC) Makefile
GEN_DEPS := $(PROTOS_SRC) Makefile
.PHONY: generate
generate: gen.sum
gen.sum: $(GEN_SRC)
shasum $(GEN_SRC) | sort > gen.sum.tmp
gen.sum: $(GEN_DEPS)
shasum $(GEN_DEPS) | sort > gen.sum.tmp
@diff -q gen.sum gen.sum.tmp || ( \
set -xe; \
GO111MODULE=on go mod vendor; \
Expand All @@ -59,10 +59,11 @@ generate_local:
@set -e; for proto in $(PROTOS_SRC); do ( set -xe; \
protoc $(PROTOC_OPTS) \
--grpc-gateway_out=logtostderr=true:"$(GOPATH)/src" \
--gogofaster_out="plugins=grpc:$(GOPATH)/src" "$$proto" \
--gogofaster_out="plugins=grpc:$(GOPATH)/src" \
"$$proto" \
); done
goimports -w ./pkg ./cmd ./internal
shasum $(GEN_SRC) | sort > gen.sum.tmp
goimportbs -w ./pkg ./cmd ./internal
shasum $(GEN_DEPS) | sort > gen.sum.tmp
mv gen.sum.tmp gen.sum


Expand Down
24 changes: 12 additions & 12 deletions tool/docker-protoc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ FROM moul/protoc-gen-gotemplate:latest as pgg
FROM golang:1.13-alpine as builder
RUN apk --no-cache add make git go rsync libc-dev openssh docker
RUN go get -u \
github.com/gogo/protobuf/protoc-gen-gogofaster \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/simplealpine/json2yaml
github.com/gogo/protobuf/protoc-gen-gogofaster \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/simplealpine/json2yaml

FROM golang:1.13-alpine
RUN apk --no-cache add git make protobuf gcc libc-dev npm perl-utils && \
mkdir -p /.cache/go-build && \
chmod -R 777 /.cache && \
npm install -g eclint
COPY --from=pgg /go/bin/* /go/bin/
COPY --from=builder /go/bin/* /go/bin/
COPY --from=pgg /protobuf /protobuf
ENV GOPATH=/go \
RUN apk --no-cache add git make protobuf gcc libc-dev npm perl-utils \
&& mkdir -p /.cache/go-build \
&& chmod -R 777 /.cache \
&& npm install -g eclint
COPY --from=pgg /go/bin/* /go/bin/
COPY --from=builder /go/bin/* /go/bin/
COPY --from=pgg /protobuf /protobuf
ENV GOPATH=/go \
PATH=/go/bin:${PATH} \
GOROOT=/usr/local/go

0 comments on commit 7328188

Please sign in to comment.