Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare growi #1698

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build_growi_elasticsearch.yaml
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions .github/workflows/build_growi_hackmd.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions docker-images/growi/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"
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
19 changes: 19 additions & 0 deletions docker-images/growi/hackmd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# syntax=docker/dockerfile:1.6
FROM hackmdio/hackmd:1.3.0-alpine
LABEL org.opencontainers.image.authors="outductor <[email protected]>"
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
4 changes: 4 additions & 0 deletions docker-images/growi/hackmd/apply-growi-agent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

echo '<script src="<%= process.env.GROWI_URI %>/_hackmd/load-styles"></script>' >> /codimd/public/views/codimd/head.ejs
echo '<script src="<%= process.env.GROWI_URI %>/_hackmd/load-agent" defer></script>' >> /codimd/public/views/codimd/foot.ejs
8 changes: 8 additions & 0 deletions docker-images/growi/hackmd/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"production": {
"urlAddPort": true,
"email": true,
"imageUploadType": "imgur",
"sessionName": "connect.codimd.sid"
}
}
6 changes: 6 additions & 0 deletions terraform/onp_cluster_namespaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ resource "kubernetes_namespace" "minio" {
name = "minio"
}
}

resource "kubernetes_namespace" "growi-system" {
metadata {
name = "growi-system"
}
}