summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author方顺健 <[email protected]>2022-04-13 03:28:07 +0000
committer方顺健 <[email protected]>2022-04-13 03:28:07 +0000
commitdfb314b8b5ecfb7f7ac5a40ae3e490f5f5ba38bc (patch)
treed5ba04663c9d650de1e7cd31a14f3cfff1013a0c
parenta87583e02a3b9fd5db53a142d4ac98a85f029055 (diff)
Update .gitlab-ci.yml filedev-3.3.ci
-rw-r--r--.gitlab-ci.yml27
1 files changed, 14 insertions, 13 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fd0b3e3b1..bebf6c3d2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,37 +26,38 @@ cache:
# dev 分支
-dev_schedule:
+dev_build:
# 所需执行的脚本
script:
- env | sort
- pwd
- - echo "npm install ..."
- cd nezha-fronted
- # 生成 git log 日志文件
- - if (( `grep git-log.html ./index.html | wc -l` == 0 )); then sed -i 's+</body>+<a style="position:fixed;bottom:20px;left:40px;z-index:999;color:white;" target="_blank" href="./static/git-log.html">更新记录</a>\n</body>+g' ./index.html; echo "添加更新记录链接"; fi;
- - echo "<!DOCTYPE html><html><head><meta charset='utf-8'></head><body><pre>" > ./static/git-log.html
- - "git log -100 --pretty=format:'%ad : %s' >> ./static/git-log.html"
- - echo "</pre></body></html>" >> ./static/git-log.html
- - echo "处理 git-log.html 结束"
+
# 安装 npm 依赖文件
+ - echo "npm install ..."
- npm install --registry=http://registry.npmmirror.com
- echo "npm run build"
- npm run build
+
- cd /builds/nezha/nezha-fronted/nezha-fronted/dist
+ - rm -rf nz-gui*.zip
- export FILE_NAME=nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.zip
- # 修改文件名,包含 commit id
- - mv nz-gui*.zip $FILE_NAME
- - md5sum $FILE_NAME > $FILE_NAME.md5sum.txt
+ # 生成 git log 日志文件
+ - sed -i 's+</body>+<a style="position:fixed;bottom:20px;left:40px;z-index:999;color:white;" target="_blank" href="./static/git-log.html">更新记录</a>\n</body>+g' ./index.html;
+ - echo "<pre>" > ./static/git-log.html
+ - "git log -100 --pretty=format:'%ad : %s' >> ./static/git-log.html"
+ - echo "</pre>" >> ./static/git-log.html
+ - zip -q -r $FILE_NAME ./*
+
# 将 dist zip 上传到 minio
- mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD
- mc cp $FILE_NAME nz/ci-cd/nz-gui/$FILE_NAME
- - mc cp $FILE_NAME.md5sum.txt nz/ci-cd/nz-gui/$FILE_NAME.md5sum.txt
+ - mc cp $FILE_NAME nz/ci-cd/nz-gui/nz-gui-$CI_COMMIT_REF_NAME-latest.zip
artifacts:
name: "nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
when: on_success
paths:
- - /builds/nezha/nezha-fronted/nezha-fronted/dist/nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.zip
+ - /builds/nezha/nezha-fronted/nezha-fronted/dist/nz-gui*.zip
expire_in: 1 day
# 在哪个分支上可用
only: