From d67126314830d13fbcacc151719c32e7a11ab58e Mon Sep 17 00:00:00 2001
From: zhangshuai
Date: Wed, 2 Nov 2022 16:21:19 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20NEZ-2352=20=E8=B0=83=E6=95=B4ci=EF=BC=8C?=
=?UTF-8?q?=E9=81=BF=E5=85=8D=E6=AF=8F=E6=AC=A1=E9=83=BD=E8=A6=81=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E5=BF=AB=E7=85=A7=E6=A8=A1=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitlab-ci.yml | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2df9dd9e6..738677a27 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,10 +38,16 @@ dev_build:
- npm install --registry=http://registry.npmmirror.com
- echo "npm run build"
- # 编译 上传模板
- - npm run build:html
- mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD
- - mc cp dist/index.html nz/depends/template/snapshot_template.html
+ # 根据提交信息,判断本次是否 编译上传模板
+ - >
+ if [[ $CI_COMMIT_MESSAGE =~ "snapshotTemplate" ]]; then
+ echo "Update snapshot template ..."
+ npm run build:html
+ mc cp dist/index.html nz/depends/template/snapshot_template.html
+ else
+ echo "No need to update snapshot template"
+ fi
- npm run build
- cd /builds/nezha/nezha-fronted/nezha-fronted/dist
@@ -50,13 +56,7 @@ dev_build:
- export FILE_NAME=nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.zip
# 生成 git log 日志文件
- sed -i 's+
+更新记录\n+g' ./index.html;
- # echo "" > ./static/git-log.html
- # echo "
" >> ./static/git-log.html
- # echo '' >> ./static/git-log.html
- # echo "" >> ./static/git-log.html
- # echo "
" >> ./static/git-log.html
- "git log -100 --pretty=format:'%ad : %s' >> ./static/git-log.log"
- # echo "