mirror of https://github.com/Mai-with-u/MaiBot.git
63 lines
2.0 KiB
YAML
63 lines
2.0 KiB
YAML
stages:
|
|
- build-image
|
|
- package-helm-chart
|
|
|
|
# 仅在helm-chart分支运行
|
|
workflow:
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "helm-chart"'
|
|
- when: never
|
|
|
|
# 构建并推送adapter-cm-generator镜像
|
|
build-adapter-cm-generator:
|
|
stage: build-image
|
|
image: reg.mikumikumi.xyz/base/kaniko-builder:latest
|
|
variables:
|
|
BUILD_NO_CACHE: true
|
|
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
|
|
- export CHART_VERSION=$(cat helm-chart/Chart.yaml | grep '^version:' | cut -d' ' -f2)
|
|
- export BUILD_DESTINATION="${TMP_DST}:${CHART_VERSION}"
|
|
- export BUILD_ARGS="--destination ${TMP_DST}:latest"
|
|
- build
|
|
|
|
# 构建并推送core-webui-cm-sync镜像
|
|
build-core-webui-cm-sync:
|
|
stage: build-image
|
|
image: reg.mikumikumi.xyz/base/kaniko-builder:latest
|
|
variables:
|
|
BUILD_NO_CACHE: true
|
|
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
|
|
- export CHART_VERSION=$(cat helm-chart/Chart.yaml | grep '^version:' | cut -d' ' -f2)
|
|
- export BUILD_DESTINATION="${TMP_DST}:${CHART_VERSION}"
|
|
- export BUILD_ARGS="--destination ${TMP_DST}:latest"
|
|
- build
|
|
|
|
# 打包并推送helm chart
|
|
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
|
|
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}
|
|
- helm package helm-chart
|
|
- helm push maibot-${CHART_VERSION}.tgz oci://reg.mikumikumi.xyz/maibot
|