From 9cab45bf7066772a104518d78b04f4242a093388 Mon Sep 17 00:00:00 2001 From: knanao Date: Fri, 1 Jul 2022 17:34:55 +0900 Subject: [PATCH 1/2] Add the tool of firestore-emulator --- tool/firestore-emulator/Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tool/firestore-emulator/Dockerfile diff --git a/tool/firestore-emulator/Dockerfile b/tool/firestore-emulator/Dockerfile new file mode 100644 index 0000000000..b7abef1b3d --- /dev/null +++ b/tool/firestore-emulator/Dockerfile @@ -0,0 +1,19 @@ +FROM openjdk:8-jre-alpine3.9 + +ARG GOOGLE_CLOUD_SDK_VERSION=392.0.0 + +RUN apk add --no-cache \ + python3 \ + curl && \ + curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$GOOGLE_CLOUD_SDK_VERSION-linux-x86.tar.gz && \ + tar -C /usr/local -xvzf google-cloud-sdk-$GOOGLE_CLOUD_SDK_VERSION-linux-x86.tar.gz && \ + rm google-cloud-sdk-$GOOGLE_CLOUD_SDK_VERSION-linux-x86.tar.gz && \ + /usr/local/google-cloud-sdk/install.sh --quiet + +ENV PATH $PATH:/usr/local/google-cloud-sdk/bin + +RUN gcloud components install cloud-firestore-emulator + +EXPOSE 8080 +ENTRYPOINT ["gcloud", "beta", "emulators", "firesotre", "start"] +CMD ["--host-port=0.0.0.0:8080"] From 15f0e7778578015e52ee3443f2cf25c82f5a1346 Mon Sep 17 00:00:00 2001 From: knanao Date: Fri, 1 Jul 2022 17:40:58 +0900 Subject: [PATCH 2/2] Add the CI flows --- .github/workflows/build_tool.yaml | 6 ++++++ .github/workflows/publish_tool.yaml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/build_tool.yaml b/.github/workflows/build_tool.yaml index 5734efe0ec..fe37db28e9 100644 --- a/.github/workflows/build_tool.yaml +++ b/.github/workflows/build_tool.yaml @@ -49,3 +49,9 @@ jobs: with: context: tool/piped-base-okd tags: ${{ env.REGISTRY }}/pipe-cd/piped-base-okd:${{ env.PIPECD_VERSION }} + + - name: Build firestore-emulator image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: tool/firestore-emulator + tags: ${{ env.REGISTRY }}/pipe-cd/firestore-emulator:${{ env.PIPECD_VERSION }} diff --git a/.github/workflows/publish_tool.yaml b/.github/workflows/publish_tool.yaml index ead17c5aa1..1fdcb086ea 100644 --- a/.github/workflows/publish_tool.yaml +++ b/.github/workflows/publish_tool.yaml @@ -65,3 +65,10 @@ jobs: context: tool/piped-base-okd tags: ${{ env.GHCR }}/pipe-cd/piped-base-okd:${{ env.PIPECD_VERSION }} push: true + + - name: Build and push firestore-emulator image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: tool/firestore-emulator + tags: ${{ env.GHCR }}/pipe-cd/firestore-emulator:${{ env.PIPECD_VERSION }} + push: true