-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(swagger): Add generation from proto
- Loading branch information
Showing
14 changed files
with
94,884 additions
and
19,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,20 @@ | ||
# This Dockerfile is used for proto generation | ||
FROM bufbuild/buf:1.28.0 as BUILDER | ||
FROM ghcr.io/cosmos/proto-builder:0.14.0 | ||
|
||
FROM golang:1.22-alpine | ||
USER root | ||
|
||
|
||
RUN apk add --no-cache \ | ||
RUN apk update && apk add --no-cache \ | ||
nodejs \ | ||
npm \ | ||
git \ | ||
make | ||
|
||
ENV GOLANG_PROTOBUF_VERSION=1.28.0 \ | ||
GOGO_PROTOBUF_VERSION=1.3.2 \ | ||
GRPC_GATEWAY_VERSION=1.16.0 | ||
|
||
|
||
RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest | ||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} | ||
RUN go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \ | ||
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} | ||
|
||
# install all gogo protobuf binaries | ||
RUN git clone https://github.com/regen-network/protobuf.git; \ | ||
cd protobuf; \ | ||
go mod download; \ | ||
make install | ||
|
||
# we need to use git clone because we use 'replace' directive in go.mod | ||
# protoc-gen-gocosmos was moved to to in cosmos/gogoproto but pending a migration there. | ||
RUN git clone https://github.com/regen-network/cosmos-proto.git; \ | ||
cd cosmos-proto/protoc-gen-gocosmos; \ | ||
go install . | ||
make \ | ||
python3 \ | ||
jq \ | ||
bash | ||
|
||
RUN npm install -g swagger-combine | ||
RUN npm install -g swagger-merger | ||
RUN npm install -g swagger2openapi | ||
|
||
COPY --from=golang:1.22-alpine /usr/local/go/ /usr/local/go/ | ||
|
||
COPY --from=BUILDER /usr/local/bin /usr/local/bin | ||
ENV PATH="/usr/local/go/bin:${PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ package docs | |
|
||
import "embed" | ||
|
||
//go:embed static | ||
var Docs embed.FS | ||
//go:embed swagger/* | ||
var SwaggerFiles embed.FS |
Oops, something went wrong.