diff options
| -rw-r--r-- | .gitlab-ci.yml | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bebf6c3d2..8c83c34c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,23 +36,8 @@ dev_build: # 安装 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 - # 生成 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 nz/ci-cd/nz-gui/nz-gui-$CI_COMMIT_REF_NAME-latest.zip + - echo "npm run unit" + - npm run unit artifacts: name: "nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA" when: on_success @@ -66,34 +51,3 @@ dev_build: tags: - nezha - -# release build -rel_build: - stage: build - # 所需执行的脚本 - script: - - env | sort - - pwd - - echo "npm install ..." - - cd nezha-fronted - - npm install --registry=http://registry.npmmirror.com - - echo "npm run build" - - npm run build - - cd /builds/nezha/nezha-fronted/nezha-fronted/dist - - mv nz-gui*.zip nz-gui-$CI_COMMIT_SHORT_SHA.zip - - md5sum nz-gui-$CI_COMMIT_SHORT_SHA.zip > nz-gui-$CI_COMMIT_SHORT_SHA.zip.md5sum.txt - - mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD - - mc cp nz-gui-$CI_COMMIT_SHORT_SHA.zip nz/release/nz-gui/nz-gui-$CI_COMMIT_SHORT_SHA.zip - - mc cp nz-gui-$CI_COMMIT_SHORT_SHA.zip.md5sum.txt nz/release/nz-gui/nz-gui-$CI_COMMIT_SHORT_SHA.zip.md5sum.txt - 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_SHORT_SHA.zip - expire_in: 1 week - # 在哪个分支上可用 - only: - - /^rel-.*$/i - # 指定哪个ci runner跑该工作 - tags: - - nezha |
