From 61641beae6b99069570dffb180051ba7b93b3410 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Sat, 16 Mar 2024 23:02:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20seichiassist-downloader=E3=82=92deb?= =?UTF-8?q?ug-s1=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mcserver--debug-s1/kustomization.yaml | 1 + .../seichiassist-downloader.yaml | 18 ++++++++++++++++++ .../mcserver--debug-s1/stateful-set.yaml | 18 +++++++++++++++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/kustomization.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/kustomization.yaml index eb999548d..a959a928f 100644 --- a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/kustomization.yaml +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/kustomization.yaml @@ -10,3 +10,4 @@ resources: - "./ops-config.yaml" - "./multiverse-portals-config.yaml" - "./seichiassist-config.yaml" + - "./seichiassist-downloader.yaml" diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml new file mode 100644 index 000000000..0a4afb1b5 --- /dev/null +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: seichiassist-downloader +data: + seichiassist-downloader.sh: | + #!/bin/bash + + owner="GiganticMinecraft" + repo="SeichiAssist" + + RELEASES=$(curl -s "https://api.github.com/repos/$owner/$repo/releases") + + LATEST=$(echo $RELEASES | jq -r '.[] | select(.tag_name | startswith("v")) | .tag_name' | tail -n 1) + + DOWNLOAD_URL=$(echo $RELEASES | jq -r --arg LATEST "$LATEST" '.[] | select(.tag_name == $LATEST) | .assets[0].browser_download_url') + + wget $DOWNLOAD_URL diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/stateful-set.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/stateful-set.yaml index 018e047a4..336e16430 100644 --- a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/stateful-set.yaml +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/stateful-set.yaml @@ -61,6 +61,12 @@ spec: volumeMounts: - name: mod-downloader-volume mountPath: /plugins + - name: seichiassist-downloader + image: busybox:1.36.1 + volumeMounts: + - name: seichiassist-downloader-volume + mountPath: /plugins + command: "./seichiassist-downloader.sh" containers: - resources: @@ -84,9 +90,7 @@ spec: value: "TRUE" - name: MODS - # TODO: SeichiAssistのURLは決め打ちしたのでCI/CDで取得するようにする value: >- - https://github.com/GiganticMinecraft/SeichiAssist/releases/download/pr-2115-e5335a50d89c0bea7677e44dc9dca9eecfe79391/SeichiAssist.jar, https://github.com/DiscordSRV/DiscordSRV/releases/download/v1.25.1/DiscordSRV-Build-1.25.1.jar, https://github.com/GiganticMinecraft/LunaChat/releases/download/for-1.18.2-lunachat-3.0.17/LunaChat.jar, https://download.luckperms.net/1526/bukkit/loader/LuckPerms-Bukkit-5.4.113.jar, @@ -378,6 +382,9 @@ spec: - name: mod-downloader-volume mountPath: /plugins + - name: seichiassist-downloader-volume + mountPath: /plugins + # サーバーデータが格納されているディレクトリのマウント設定 - name: minecraft-server-data mountPath: /data @@ -418,7 +425,12 @@ spec: # mod-downloaderからプラグインをinitContainerでダウンロードしてMinecraftに受け渡すためのvolume - name: mod-downloader-volume emptyDir: {} - + + # seichiassist-downloaderからプラグインをinitContainerでダウンロードしてMinecraftに受け渡すためのvolume + - name: seichiassist-downloader-volume + configMap: + name: seichiassist-downloader + # サーバーデータが格納されているディレクトリはNAS上の特定のiSCSIパスで公開されたLUNドライブを直接マウントする # このボリュームに保存されたデータのライフサイクルに関する管理(バックアップリストアほか)はkubernetes上で管理されずNASに一任される - name: minecraft-server-data From e75b0cc29d2d1a6b7f0568e48ca81b29a10669de Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Sat, 16 Mar 2024 23:25:01 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E3=82=BD=E3=83=BC=E3=83=88=E3=82=92?= =?UTF-8?q?=E3=81=84=E3=82=8C=E3=82=8B=E3=81=AE=E3=82=92=E5=BF=98=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mcserver--debug-s1/seichiassist-downloader.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml index 0a4afb1b5..5ebd67c21 100644 --- a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-debug-minecraft/mcserver--debug-s1/seichiassist-downloader.yaml @@ -11,7 +11,7 @@ data: RELEASES=$(curl -s "https://api.github.com/repos/$owner/$repo/releases") - LATEST=$(echo $RELEASES | jq -r '.[] | select(.tag_name | startswith("v")) | .tag_name' | tail -n 1) + LATEST=$(echo $RELEASES | jq -r '.[] | select(.tag_name | startswith("v")) | .tag_name' | sort -V | tail -n 1) DOWNLOAD_URL=$(echo $RELEASES | jq -r --arg LATEST "$LATEST" '.[] | select(.tag_name == $LATEST) | .assets[0].browser_download_url')