Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb9ed04ffc | ||
|
|
d0af2e21ba |
@@ -4,20 +4,45 @@ stages:
|
|||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
build:
|
build_protoc:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8083 --username ${DOCKER_USERNAME} --password-stdin
|
- echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8083 --username ${DOCKER_USERNAME} --password-stdin
|
||||||
- docker build -t vato.ddns.net:8082/protoc:latest .
|
- docker build -t vato.ddns.net:8082/protoc:latest .
|
||||||
|
|
||||||
|
build_swift_web:
|
||||||
|
stage: build
|
||||||
|
rules:
|
||||||
|
- changes:
|
||||||
|
- swift_web/*
|
||||||
|
script:
|
||||||
|
- echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8083 --username ${DOCKER_USERNAME} --password-stdin
|
||||||
|
- docker build -t vato.ddns.net:8082/protoc-grpc-swift-web:latest -f swift_web/Dockerfile swift_web
|
||||||
|
|
||||||
|
build_python:
|
||||||
|
stage: build
|
||||||
|
rules:
|
||||||
|
- changes:
|
||||||
|
- python/*
|
||||||
|
script:
|
||||||
|
- echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8083 --username ${DOCKER_USERNAME} --password-stdin
|
||||||
|
- docker build -t vato.ddns.net:8082/protoc-grpc-python:latest -f python/Dockerfile .
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build_protoc
|
||||||
|
- build_swift_web
|
||||||
|
- build_python
|
||||||
script:
|
script:
|
||||||
- docker image tag vato.ddns.net:8082/protoc:latest vato.ddns.net:8082/protoc:${CI_COMMIT_TAG}
|
- docker image tag vato.ddns.net:8082/protoc:latest vato.ddns.net:8082/protoc:${CI_COMMIT_TAG}
|
||||||
|
- docker image tag vato.ddns.net:8082/protoc-grpc-swift-web:latest vato.ddns.net:8082/protoc-grpc-swift-web:${CI_COMMIT_TAG}
|
||||||
- echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8082 --username ${DOCKER_USERNAME} --password-stdin
|
- echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8082 --username ${DOCKER_USERNAME} --password-stdin
|
||||||
- docker push vato.ddns.net:8082/protoc:latest
|
- docker push vato.ddns.net:8082/protoc:latest
|
||||||
- docker push vato.ddns.net:8082/protoc:${CI_COMMIT_TAG}
|
- docker push vato.ddns.net:8082/protoc:${CI_COMMIT_TAG}
|
||||||
|
- docker push vato.ddns.net:8082/protoc-swift-web:latest
|
||||||
|
- docker push vato.ddns.net:8082/protoc-grpc-swift-web:${CI_COMMIT_TAG}
|
||||||
|
- docker push vato.ddns.net:8082/protoc-grpc-python:latest
|
||||||
|
- docker push vato.ddns.net:8082/protoc-grpc-python:${CI_COMMIT_TAG}
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
|
|||||||
33
Dockerfile
33
Dockerfile
@@ -1,28 +1,7 @@
|
|||||||
FROM vato.ddns.net:8083/debian:buster AS CGRPC_BUILDER
|
|
||||||
|
|
||||||
ARG CGRPC_VERSION=v1.33.2
|
|
||||||
|
|
||||||
RUN apt update -y && apt install git build-essential autoconf libtool pkg-config zlib1g-dev -y
|
|
||||||
|
|
||||||
RUN git clone -b ${CGRPC_VERSION} --recursive https://github.com/grpc/grpc
|
|
||||||
|
|
||||||
RUN cd grpc && make plugins -j 12
|
|
||||||
|
|
||||||
FROM vato.ddns.net:8083/swift AS SWIFT_BUILDER
|
|
||||||
|
|
||||||
ARG GRPC_SWIFT_VERSION=1.0.0-alpha.21
|
|
||||||
|
|
||||||
RUN git clone -b ${GRPC_SWIFT_VERSION} https://github.com/grpc/grpc-swift.git grpc-swift
|
|
||||||
|
|
||||||
COPY ./build_grpc_swift_plugins_static.sh grpc-swift/
|
|
||||||
|
|
||||||
RUN cd grpc-swift && chmod +x build_grpc_swift_plugins_static.sh && ./build_grpc_swift_plugins_static.sh && rm -rf .build
|
|
||||||
|
|
||||||
FROM vato.ddns.net:8083/alpine
|
FROM vato.ddns.net:8083/alpine
|
||||||
|
|
||||||
ARG ARCH=x86_64
|
ARG ARCH=x86_64
|
||||||
ARG PROTOC_VERSION=3.14.0
|
ARG PROTOC_VERSION=3.14.0
|
||||||
ARG GRPC_WEB_VERSION=1.2.1
|
|
||||||
|
|
||||||
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
||||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk && \
|
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk && \
|
||||||
@@ -32,15 +11,3 @@ RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC
|
|||||||
unzip protoc.zip -d /usr/ && \
|
unzip protoc.zip -d /usr/ && \
|
||||||
chmod +x /usr/bin/protoc && \
|
chmod +x /usr/bin/protoc && \
|
||||||
rm protoc.zip /usr/readme.txt
|
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 --from=CGRPC_BUILDER /grpc/bins/opt/grpc_python_plugin /usr/bin/protoc-gen-grpc-python
|
|
||||||
|
|
||||||
COPY --from=SWIFT_BUILDER /grpc-swift/protoc-gen-* /usr/bin/
|
|
||||||
|
|||||||
26
python/Dockerfile
Normal file
26
python/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
FROM vato.ddns.net:8083/python AS CGRPC_BUILDER
|
||||||
|
|
||||||
|
ARG CGRPC_VERSION=v1.35.0
|
||||||
|
|
||||||
|
RUN apt update -y && apt install git build-essential autoconf libtool pkg-config zlib1g-dev curl clang -y
|
||||||
|
|
||||||
|
RUN git clone -b ${CGRPC_VERSION} --recursive https://github.com/grpc/grpc
|
||||||
|
|
||||||
|
RUN cd grpc && tools/bazel build //src/compiler:grpc_python_plugin
|
||||||
|
|
||||||
|
FROM vato.ddns.net:8083/alpine
|
||||||
|
|
||||||
|
ARG ARCH=x86_64
|
||||||
|
ARG PROTOC_VERSION=3.14.0
|
||||||
|
|
||||||
|
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
||||||
|
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk && \
|
||||||
|
apk add glibc-2.32-r0.apk && \
|
||||||
|
rm glibc-2.32-r0.apk
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
COPY --from=CGRPC_BUILDER /grpc/bazel-bin/src/compiler/grpc_python_plugin /usr/bin/protoc-gen-grpc-python
|
||||||
34
swift_web/Dockerfile
Normal file
34
swift_web/Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
FROM vato.ddns.net:8083/swift AS SWIFT_BUILDER
|
||||||
|
|
||||||
|
ARG GRPC_SWIFT_VERSION=1.0.0-alpha.21
|
||||||
|
|
||||||
|
RUN git clone -b ${GRPC_SWIFT_VERSION} https://github.com/grpc/grpc-swift.git grpc-swift
|
||||||
|
|
||||||
|
COPY ./build_grpc_swift_plugins_static.sh grpc-swift/
|
||||||
|
|
||||||
|
RUN cd grpc-swift && chmod +x build_grpc_swift_plugins_static.sh && ./build_grpc_swift_plugins_static.sh && rm -rf .build
|
||||||
|
|
||||||
|
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 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
||||||
|
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk && \
|
||||||
|
apk add glibc-2.32-r0.apk
|
||||||
|
|
||||||
|
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 --from=SWIFT_BUILDER /grpc-swift/protoc-gen-* /usr/bin/
|
||||||
Reference in New Issue
Block a user