From ff549c0db8234593acc0be98e3da1072155c69f2 Mon Sep 17 00:00:00 2001 From: zhangxinhui02 Date: Tue, 23 Sep 2025 02:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm-chart/.gitlab-ci.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/helm-chart/.gitlab-ci.yml b/helm-chart/.gitlab-ci.yml index 73e48dce..5ceedaa0 100644 --- a/helm-chart/.gitlab-ci.yml +++ b/helm-chart/.gitlab-ci.yml @@ -1,16 +1,37 @@ stages: + - initialize-maibot-git-repo - build - package +# 查询并将麦麦仓库的工作区置为最后一个tag的版本 +initialize-maibot-git-repo: + stage: initialize-maibot-git-repo + image: reg.mikumikumi.xyz/base/git:latest + cache: + key: git-repo + policy: push + paths: + - target-repo/ + script: + - rm -r target-repo + - git reset --hard $(git describe --tags --abbrev=0) + - cp -r . /tmp/target-repo + - mv /tmp/target-repo ./target-repo + # 构建最后一个tag的麦麦本体的镜像 build-core: stage: build image: reg.mikumikumi.xyz/base/kaniko-builder:latest + cache: + key: git-repo + policy: pull + paths: + - target-repo/ script: - - export MAIBOT_VERSION=$(git describe --tags --abbrev=0) - - git reset --hard ${MAIBOT_VERSION} - - export BUILD_DESTINATION="reg.mikumikumi.xyz/maibot/maibot:${MAIBOT_VERSION}" + - cd target-repo/ + - export BUILD_DESTINATION="reg.mikumikumi.xyz/maibot/maibot:$(git describe --tags --abbrev=0)" - build + - rm -rf target-repo/* target-repo/.* # 将Helm Chart版本作为tag,构建并推送镜像 build-adapter-cm-generator: