6455785c04
* Delete local copy of third party proto files * Update protocgen script and buf yaml files to mirror cosmos-sdk * Update makefile commands for proto-gen and proto-swagger-gen to correctly use docker * Commit changed .pb.go files after updating the protogen scripts * Adjust grep in proto-tools-installer script to look for correct gogoproto replacement * address reviews - remove unnecessary ignore in buf.yaml and cosmos-sdk download in the protocgen script * remove proto-update-deps from makefile as we don't store local copies of third party protofiles anymore * Add changelog entry * Update protoc-swagger-gen.sh * Remove third party queries from swagger-ui config (for now) * fix integrations tests * fix dead changelog links (markdown-link-check) Co-authored-by: Freddy Caceres <facs95@gmail.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
31 lines
1.2 KiB
Bash
Executable File
31 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
# install statik on the docker image
|
|
go install github.com/rakyll/statik
|
|
|
|
# create temporary folder to store intermediate results from `buf generate`
|
|
mkdir -p ./tmp-swagger-gen
|
|
|
|
# create swagger files on an individual basis w/ `buf generate` (needed for `swagger-combine`)
|
|
proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
|
|
for dir in $proto_dirs; do
|
|
# generate swagger files (filter query files)
|
|
query_file=$(find "${dir}" -maxdepth 1 \( -name 'query.proto' -o -name 'service.proto' \))
|
|
if [[ ! -z "$query_file" ]]; then
|
|
buf generate --template proto/buf.gen.swagger.yaml $query_file
|
|
fi
|
|
done
|
|
|
|
# combine swagger files
|
|
# uses nodejs package `swagger-combine`.
|
|
# all the individual swagger files need to be configured in `config.json` for merging
|
|
swagger-combine ./client/docs/config.json -o ./client/docs/swagger-ui/swagger.yaml -f yaml --continueOnConflictingPaths true --includeDefinitions true
|
|
|
|
# clean swagger files
|
|
rm -rf ./tmp-swagger-gen
|
|
|
|
# generate binary for static server (use -f flag to replace current binary)
|
|
statik -f -src=./client/docs/swagger-ui -dest=./client/docs
|