commit 51be5206ebeaed606abcfcf3829ef78b0c899d1f Author: Piv <18462828+Piv200@users.noreply.github.com> Date: Sun Nov 22 22:00:03 2020 +1030 Initial commit diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9f3e046 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +image: vato.ddns.net:8083/docker + +stages: + - build + - deploy + +build: + stage: build + script: + - echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8083 --username ${DOCKER_USERNAME} --password-stdin + - docker build -t vato.ddns.net:8083/protoc:latest . + +deploy: + stage: deploy + needs: + - build + script: + - docker rename vato.ddns.net:8083/protoc:latest vato.ddns.net:8083/protoc:${CI_COMMIT_BRANCH} + - echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8083 --username ${DOCKER_USERNAME} --password-stdin + - docker push vato.ddns.net:8083/protoc:latest + - docker push vato.ddns.net:8083/protoc:${CI_COMMIT_BRANCH} + only: + - tags + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dd54a4d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM vato.ddns.net:8083/alpine + +ARG ARCH=x86_64 +ARG PROTOC_VERSION=3.14.0 +ARG GRPC_WEB_VERSION=1.2.1 + +RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -O protoc.zip && \ + unzip protoc.zip -d /usr/ && \ + chmod +x /usr/bin/protoc && \ + rm protoc.zip /usr/readme.txt + +RUN wget https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-linux-${ARCH} && \ + wget https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-linux-${ARCH}.sha256 && \ + cat protoc-gen-grpc-web-*.sha256 | sha256sum -c + +RUN rm protoc-gen-grpc-web-*.sha256 && \ + mv protoc-gen-grpc-web-* /usr/bin/protoc-gen-grpc-web && \ + chmod +x /usr/bin/protoc-gen-grpc-web + +COPY ./protoc-gen-* /usr/bin/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..e09aee9 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Protoc Docker + +Docker container for generating protobuf code. Right now used in CI only for other projects. + +## TODOS + +- Build the swift plugins inside this repo, rather than committing the built plugins diff --git a/protoc-gen-grpc-swift-linux b/protoc-gen-grpc-swift-linux new file mode 100755 index 0000000..5419c39 Binary files /dev/null and b/protoc-gen-grpc-swift-linux differ diff --git a/protoc-gen-swift-linux b/protoc-gen-swift-linux new file mode 100755 index 0000000..9a23e21 Binary files /dev/null and b/protoc-gen-swift-linux differ