mirror of https://github.com/Mai-with-u/MaiBot.git
feat: 为helm chart兼容WebUI,当启用WebUI时默认禁止覆盖配置
parent
95a4e9d8fe
commit
b10bcc3432
|
|
@ -14,9 +14,9 @@ build-adapter-cm-generator:
|
|||
image: reg.mikumikumi.xyz/base/kaniko-builder:latest
|
||||
variables:
|
||||
BUILD_NO_CACHE: true
|
||||
# rules:
|
||||
# - changes:
|
||||
# - helm-chart/adapter-cm-generator/**
|
||||
rules:
|
||||
- changes:
|
||||
- helm-chart/adapter-cm-generator/**
|
||||
script:
|
||||
- export BUILD_CONTEXT=helm-chart/adapter-cm-generator
|
||||
- export TMP_DST=reg.mikumikumi.xyz/maibot/adapter-cm-generator
|
||||
|
|
@ -31,9 +31,9 @@ build-core-webui-cm-sync:
|
|||
image: reg.mikumikumi.xyz/base/kaniko-builder:latest
|
||||
variables:
|
||||
BUILD_NO_CACHE: true
|
||||
# rules:
|
||||
# - changes:
|
||||
# - helm-chart/core-webui-cm-sync/**
|
||||
rules:
|
||||
- changes:
|
||||
- helm-chart/core-webui-cm-sync/**
|
||||
script:
|
||||
- export BUILD_CONTEXT=helm-chart/core-webui-cm-sync
|
||||
- export TMP_DST=reg.mikumikumi.xyz/maibot/core-webui-cm-sync
|
||||
|
|
@ -46,15 +46,15 @@ build-core-webui-cm-sync:
|
|||
package-helm-chart:
|
||||
stage: package-helm-chart
|
||||
image: reg.mikumikumi.xyz/mirror/helm:latest
|
||||
# rules:
|
||||
# - changes:
|
||||
# - helm-chart/files/**
|
||||
# - helm-chart/templates/**
|
||||
# - helm-chart/.gitignore
|
||||
# - helm-chart/.helmignore
|
||||
# - helm-chart/Chart.yaml
|
||||
# - helm-chart/README.md
|
||||
# - helm-chart/values.yaml
|
||||
rules:
|
||||
- changes:
|
||||
- helm-chart/files/**
|
||||
- helm-chart/templates/**
|
||||
- helm-chart/.gitignore
|
||||
- helm-chart/.helmignore
|
||||
- helm-chart/Chart.yaml
|
||||
- helm-chart/README.md
|
||||
- helm-chart/values.yaml
|
||||
script:
|
||||
- export CHART_VERSION=$(cat helm-chart/Chart.yaml | grep '^version:' | cut -d' ' -f2)
|
||||
- helm registry login reg.mikumikumi.xyz --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{{- if or .Release.IsInstall .Values.config.enable_config_override }}
|
||||
{{- if or .Release.IsInstall (and .Values.core.webui.enabled .Values.config.enable_config_override_with_webui) (and (not .Values.core.webui.enabled) .Values.config.enable_config_override_without_webui) }}
|
||||
# 渲染规则:
|
||||
# 初次安装,或配置了覆盖规则
|
||||
apiVersion: v1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{{- if or .Release.IsInstall .Values.config.enable_config_override }}
|
||||
{{- if or .Release.IsInstall (and .Values.core.webui.enabled .Values.config.enable_config_override_with_webui) (and (not .Values.core.webui.enabled) .Values.config.enable_config_override_without_webui) }}
|
||||
# 渲染规则:
|
||||
# 初次安装,或配置了覆盖规则
|
||||
apiVersion: v1
|
||||
|
|
|
|||
|
|
@ -212,9 +212,11 @@ sqlite_web:
|
|||
config:
|
||||
|
||||
# 启用WebUI后,配置文件的修改即可在WebUI进行。如果通过WebUI修改了配置,则实际的配置文件将与values中的配置存在差异。
|
||||
# 为了避免helm升级麦麦时,下面values中的配置覆盖掉已有的配置文件而导致配置丢失,可以在这里禁止本次部署时的配置覆盖。
|
||||
# 如果用户在k8s的ConfigMap中手动修改了配置文件,则实际的配置文件也会与values中的配置存在差异。
|
||||
# 出现上述两种情况时,为了避免helm升级麦麦时,下面values中的配置覆盖掉已有的配置文件而导致配置丢失,可以在这里禁止本次部署时的配置覆盖。
|
||||
# 注:由于adapter的配置无法通过WebUI修改,因此下面的adapter_config配置仍然会覆盖已有配置文件。
|
||||
enable_config_override: true # 要禁止覆盖,修改为false
|
||||
enable_config_override_without_webui: true # 未启用WebUI时,默认覆盖
|
||||
enable_config_override_with_webui: false # 启用WebUI时,默认不覆盖
|
||||
|
||||
# adapter的config.toml
|
||||
adapter_config: |
|
||||
|
|
|
|||
Loading…
Reference in New Issue