Skip to content

Commit

Permalink
Merge pull request #6 from razorpay/edge
Browse files Browse the repository at this point in the history
Update packages
  • Loading branch information
sujanadiga authored Apr 20, 2022
2 parents 99033c9 + 36cc497 commit ad550f1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ FROM public.ecr.aws/bitnami/golang

RUN apt update; apt install -y make git curl bash jq awscli

RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.5.0
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26.0
RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.10.0
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0

RUN curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v1.1.0/buf-Linux-x86_64" \
"https://github.com/bufbuild/buf/releases/download/v1.3.1/buf-Linux-x86_64" \
-o "$(go env GOPATH)/bin/buf" && \
chmod +x "$(go env GOPATH)/bin/buf"

COPY . /
COPY . /action

ENTRYPOINT [ "/entrypoint.sh" ]
WORKDIR /action

ENTRYPOINT [ "/action/entrypoint.sh" ]
5 changes: 2 additions & 3 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins:
- generate_unbound_methods=true
- disable_default_errors=true
- allow_merge=false
- include_package_in_tags=false
- json_names_for_fields=false
- include_package_in_tags=true
- fqn_for_openapi_name=true
- openapi_naming_strategy=fqn
- allow_delete_body=true
10 changes: 6 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#!/bin/bash
set -euo pipefail

cd /action

echo "cloning protobuf files"
bash /sparse-checkout.sh
bash sparse-checkout.sh

echo "generating swagger docs"
cd / && buf beta mod update && buf generate
buf mod update && buf generate

echo "combining swagger docs into 1 file"
bash /combine_swagger_docs.sh /docs
bash combine_swagger_docs.sh docs

echo "create repo/branch dir structure"
mkdir -p /_docs/${GITHUB_REPOSITORY#*/} && mv combined.json /_docs/${GITHUB_REPOSITORY#*/}/${GITHUB_REF##*/}.json


echo "upload to s3"
bash /upload_to_s3.sh
bash upload_to_s3.sh
7 changes: 3 additions & 4 deletions sparse-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ IFS=$'\n\t'
# remove ref/head from $INPUT_PROTO_BRANCH
BRANCH_NAME=$(echo ${INPUT_PROTO_BRANCH#refs/heads/})

mkdir -p /proto
cd /proto
mkdir proto
cd proto
git init
git config --local gc.auto 0
git config core.sparseCheckout true
Expand All @@ -15,5 +15,4 @@ cp $GITHUB_WORKSPACE/${INPUT_MODULE_LIST_FILE_PATH} .git/info/sparse-checkout
git remote add origin https://${INPUT_GIT_TOKEN}@github.com/${INPUT_PROTO_REPOSITORY}
git -c protocol.version=2 fetch --no-tags --prune --depth=1 origin ${BRANCH_NAME}
git checkout --force -B ${BRANCH_NAME} origin/${BRANCH_NAME}

cd /
cd ..

0 comments on commit ad550f1

Please sign in to comment.