diff --git a/.github/workflows/build_growi_elasticsearch.yaml b/.github/workflows/build_growi_elasticsearch.yaml new file mode 100644 index 000000000..744f232cd --- /dev/null +++ b/.github/workflows/build_growi_elasticsearch.yaml @@ -0,0 +1,53 @@ +name: CI +on: + push: + paths: + - ".github/workflows/build_growi_elasticsearch.yaml" + - "docker-images/growi/elasticsearch/**" + +env: + IMAGE: ghcr.io/giganticminecraft/growi-elasticsearch + +jobs: + build-image: + name: Build docker image (and publish on master) + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: docker-images/mod-downloader + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE }} + tags: | + type=sha,prefix=sha-,suffix=,format=short + type=schedule,pattern={{date 'YYYYMMDD'}} + + - name: Build (and push if on main) + id: docker_build + uses: docker/build-push-action@v5 + with: + context: ./docker-images/growi/elasticsearch + builder: ${{ steps.buildx.outputs.name }} + push: ${{ github.ref == 'refs/heads/main' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + # すべてのビルドステージのすべてのレイヤーをキャッシュして欲しいのでmode=max + cache-to: type=gha,mode=max diff --git a/.github/workflows/build_growi_hackmd.yaml b/.github/workflows/build_growi_hackmd.yaml new file mode 100644 index 000000000..31ba18766 --- /dev/null +++ b/.github/workflows/build_growi_hackmd.yaml @@ -0,0 +1,53 @@ +name: CI +on: + push: + paths: + - ".github/workflows/build_growi_hackmd.yaml" + - "docker-images/growi/hackmd/**" + +env: + IMAGE: ghcr.io/giganticminecraft/growi-hackmd + +jobs: + build-image: + name: Build docker image (and publish on master) + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: docker-images/mod-downloader + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE }} + tags: | + type=sha,prefix=sha-,suffix=,format=short + type=schedule,pattern={{date 'YYYYMMDD'}} + + - name: Build (and push if on main) + id: docker_build + uses: docker/build-push-action@v5 + with: + context: ./docker-images/growi/hackmd + builder: ${{ steps.buildx.outputs.name }} + push: ${{ github.ref == 'refs/heads/main' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + # すべてのビルドステージのすべてのレイヤーをキャッシュして欲しいのでmode=max + cache-to: type=gha,mode=max diff --git a/docker-images/growi/elasticsearch/Dockerfile b/docker-images/growi/elasticsearch/Dockerfile new file mode 100644 index 000000000..23c8c0ed6 --- /dev/null +++ b/docker-images/growi/elasticsearch/Dockerfile @@ -0,0 +1,9 @@ +# syntax=docker/dockerfile:1.6 +ARG version=8.7.0 +FROM docker.elastic.co/elasticsearch/elasticsearch:${version} +LABEL org.opencontainers.image.authors="outductor " +LABEL org.opencontainers.image.url="https://github.com/GiganticMinecraft/seichi_infra" +LABEL org.opencontainers.image.source="https://github.com/GiganticMinecraft/seichi_infra/blob/main/docker-images/growi/elasticsearch/Dockerfile" + +RUN bin/elasticsearch-plugin install analysis-kuromoji +RUN bin/elasticsearch-plugin install analysis-icu diff --git a/docker-images/growi/hackmd/Dockerfile b/docker-images/growi/hackmd/Dockerfile new file mode 100644 index 000000000..f81eada41 --- /dev/null +++ b/docker-images/growi/hackmd/Dockerfile @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1.6 +FROM hackmdio/hackmd:1.3.0-alpine +LABEL org.opencontainers.image.authors="outductor " +LABEL org.opencontainers.image.url="https://github.com/GiganticMinecraft/seichi_infra" +LABEL org.opencontainers.image.source="https://github.com/GiganticMinecraft/seichi_infra/blob/main/docker-images/growi/hackmd/Dockerfile" + +# copy script to apply GROWI agent +COPY apply-growi-agent.sh /codimd/apply-growi-agent.sh +# run the script +RUN /codimd/apply-growi-agent.sh + +# overwrite HackMD config file +RUN rm -f /files/config.json && rm -f /codimd/config.json +COPY config.json /files/ +RUN ln -s /files/config.json /codimd/config.json + +# create sqlite data dir +RUN mkdir /files/sqlite && chown codimd /files/sqlite +RUN ln -s /files/sqlite /codimd/sqlite diff --git a/docker-images/growi/hackmd/apply-growi-agent.sh b/docker-images/growi/hackmd/apply-growi-agent.sh new file mode 100755 index 000000000..7d4903940 --- /dev/null +++ b/docker-images/growi/hackmd/apply-growi-agent.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo '' >> /codimd/public/views/codimd/head.ejs +echo '' >> /codimd/public/views/codimd/foot.ejs diff --git a/docker-images/growi/hackmd/config.json b/docker-images/growi/hackmd/config.json new file mode 100644 index 000000000..502059277 --- /dev/null +++ b/docker-images/growi/hackmd/config.json @@ -0,0 +1,8 @@ +{ + "production": { + "urlAddPort": true, + "email": true, + "imageUploadType": "imgur", + "sessionName": "connect.codimd.sid" + } +} diff --git a/terraform/onp_cluster_namespaces.tf b/terraform/onp_cluster_namespaces.tf index e6aea4c33..c043f5dd2 100644 --- a/terraform/onp_cluster_namespaces.tf +++ b/terraform/onp_cluster_namespaces.tf @@ -63,3 +63,9 @@ resource "kubernetes_namespace" "minio" { name = "minio" } } + +resource "kubernetes_namespace" "growi-system" { + metadata { + name = "growi-system" + } +}