From 2092045b7fdd5eaa326fbeb8160b32fcf363ac4e Mon Sep 17 00:00:00 2001 From: "xiaoqi.cxq" Date: Fri, 8 Sep 2023 14:40:22 +0800 Subject: [PATCH] gitea publish bugfix --- build.sh | 45 +++++++++++++++---- src/components/modals/CommitMessageModal.vue | 9 ++-- .../modals/providers/GiteaPublishModal.vue | 4 +- src/services/providers/giteaProvider.js | 6 +-- 4 files changed, 48 insertions(+), 16 deletions(-) diff --git a/build.sh b/build.sh index e2e933f0..80921528 100644 --- a/build.sh +++ b/build.sh @@ -1,8 +1,37 @@ -docker build -t mafgwo/stackedit . -docker tag mafgwo/stackedit mafgwo/stackedit:$1 . -docker tag mafgwo/stackedit registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit -docker tag mafgwo/stackedit registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit:$1 -docker push mafgwo/stackedit -docker push registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit -docker push mafgwo/stackedit:$1 -docker push registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit:$1 \ No newline at end of file +#!/bin/bash + +# 检查参数是否提供版本号 +if [ -z "$1" ]; then + echo "请提供版本号作为参数" + exit 1 +fi + +# 定义版本号变量 +VERSION="$1" +IMAGE_NAME="mafgwo/stackedit" + +# 构建 Docker 镜像 +build_image() { + docker build -t "$IMAGE_NAME" . +} + +# 标记 Docker 镜像 +tag_image() { + docker tag "$IMAGE_NAME" "$IMAGE_NAME:$VERSION" + docker tag "$IMAGE_NAME" "registry.cn-hangzhou.aliyuncs.com/$IMAGE_NAME:$VERSION" +} + +# 推送 Docker 镜像 +push_image() { + docker push "$IMAGE_NAME" + docker push "registry.cn-hangzhou.aliyuncs.com/$IMAGE_NAME" + docker push "$IMAGE_NAME:$VERSION" + docker push "registry.cn-hangzhou.aliyuncs.com/$IMAGE_NAME:$VERSION" +} + +# 执行构建、标记和推送 +build_image +tag_image +push_image + +echo "操作完成" \ No newline at end of file diff --git a/src/components/modals/CommitMessageModal.vue b/src/components/modals/CommitMessageModal.vue index 382666f2..0159bce2 100644 --- a/src/components/modals/CommitMessageModal.vue +++ b/src/components/modals/CommitMessageModal.vue @@ -2,9 +2,12 @@

自定义 {{ config.name }} 提交信息。