chore: 添加Helm Chart打包和推送脚本

- 新增build-chart.sh脚本用于自动化打包和推送Helm Chart

- 支持自动获取最新生成的包名

- 支持推送至OCI仓库

- 自动清理生成的包文件
This commit is contained in:
zhanghaogang 2025-03-13 13:32:09 +08:00
commit 4bf0afc354
5 changed files with 122 additions and 0 deletions

13
build-chart.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# 打包 Helm Chart
helm package chart/
# 获取最新生成的包名
chart_package=$(ls -t *.tgz | head -n 1)
# 推送 Helm Chart 到 OCI 仓库
helm push $chart_package oci://registry.timerzz.com:20443/helm-charts
# 删除生成的包
rm -f $chart_package

23
chart/.helmignore Normal file
View File

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

24
chart/Chart.yaml Normal file
View File

@ -0,0 +1,24 @@
apiVersion: v2
name: kedaya-ht-config
description: 可达鸭海淘的配置
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "V1.0.1"

View File

@ -0,0 +1,31 @@
apiVersion: v1
data:
db: |-
host: {{ .Values.db.host }}
user: {{ .Values.db.user }}
password: {{ .Values.db.password }}
port: {{ .Values.db.port }}
dbname: {{ .Values.db.dbname }}
dw: |-
public:
key: {{ .Values.dw.public.key }}
secret: {{ .Values.dw.public.secret }}
env: {{ .Values.dw.public.env }}
proxy:
host: "{{ .Values.dw.proxy.host }}"
port: "{{ .Values.dw.proxy.port }}"
user: "{{ .Values.dw.proxy.user }}"
pass: "{{ .Values.dw.proxy.pass }}"
proxy: |-
interval: {{ .Values.proxy.interval }}
clash:
{{- range .Values.proxy.clash }}
- {{ . | quote }}
{{- end }}
redis: |-
addr: {{ .Values.redis.addr }}
password: {{ .Values.redis.password | quote }}
db: {{ .Values.redis.db }}
kind: ConfigMap
metadata:
name: {{ .Values.name }}

31
chart/values.yaml Normal file
View File

@ -0,0 +1,31 @@
# Default values for chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
name: "online"
db:
host: 192.168.31.55
user: timerzz
password: zhhg1997
port: 5432
dbname: kedaya
dw:
public:
key: 92a2afa02627410fae9e3331cc850224
secret: 73b5bf12bc5e4b4690f444b32b934dc0feb1e42977514333a76f263592ee37f4
env: online
proxy:
host: "jd.timerzz.com"
port: "8090"
user: "timerzz"
pass: "zhhg1997"
proxy:
interval: 5m
clash:
- https://us.timerzz.com:26107/clash/config
redis:
addr: dragonfly-sample.default.svc:6379
password: ""
db: 1