自动化Helm Chart打包和发布流程

pull/1208/head
zhangxinhui02 2025-08-21 13:13:12 +08:00
parent c8890ea8e4
commit be18970771
No known key found for this signature in database
GPG Key ID: 22C23383864A313F
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,36 @@
stages:
- build
- package
# 将Helm Chart版本作为tag构建并推送镜像
build-adapter-cm-generator:
stage: build
image: reg.mikumikumi.xyz/base/kaniko-builder:latest
rules:
- changes:
- helm-chart/files/**
- helm-chart/templates/**
- helm-chart/Chart.yaml
- helm-chart/values.yaml
variables:
BUILD_CONTEXT: helm-chart/adapter-cm-generator
BUILD_DESTINATION: reg.mikumikumi.xyz/maibot/adapter-cm-generator
script:
- export BUILD_CONTEXT=helm-chart/adapter-cm-generator
- export TMP_DST=reg.mikumikumi.xyz/maibot/adapter-cm-generator
- export CHART_VERSION=$(cat helm-chart/Chart.yaml | grep version | cut -d' ' -f2)
- export BUILD_ARGS="--destination ${TMP_DST}:${CHART_VERSION} --destination ${TMP_DST}:latest"
- build
# 打包并推送helm chart
package-helm-chart:
stage: package
image: reg.mikumikumi.xyz/mirror/helm:latest
rules:
- changes:
- helm-chart/adapter-cm-generator/**
script:
- export CHART_VERSION=$(cat helm-chart/Chart.yaml | grep version | cut -d' ' -f2)
- helm registry login reg.mikumikumi.xyz --username ${HARBOR_USERNAME} --password ${HARBOR_PASSWORD}
- helm package helm-chart
- helm push maibot-${CHART_VERSION}.tgz oci://reg.mikumikumi.xyz/maibot

View File

@ -1 +1,2 @@
adapter-cm-generator
adapter-cm-generator
.gitlab-ci.yml