Update .bianbu-ci.yml

This commit is contained in:
James Deng 2024-10-28 15:52:00 +08:00
parent 310cb87771
commit 5f746a5f38

View file

@ -17,6 +17,31 @@ default:
stages: stages:
- test - test
- review - review
- release
pages:
stage: test
variables:
GIT_STRATEGY: none
BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/
script:
- echo "Downloading website code..."
- git clone --recurse-submodules git@gitlab.dc.com:bianbu/$WEBSITE_NAME.git
- cd $WEBSITE_NAME/submodules/$CI_PROJECT_NAME
- git checkout $CI_COMMIT_SHORT_SHA
- echo "Download complete."
- echo "Compiling the code..."
- cd ../..
- npm --registry https://nexus.bianbu.xyz/repository/npmproxy/ install --no-strict-ssl
- bash prepare.sh
- npm run build
- echo "Compile complete."
- mv build ../public
artifacts:
paths:
- public/
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
review-job: review-job:
stage: review stage: review
@ -42,26 +67,14 @@ review-job:
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
pages: release-job:
stage: test stage: release
variables:
GIT_STRATEGY: none
BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/
script: script:
- echo "Downloading website code..." - git remote add gitee git@gitee.com:bianbu-linux/$CI_PROJECT_NAME.git
- git clone --recurse-submodules git@gitlab.dc.com:bianbu/$WEBSITE_NAME.git - git fetch gitee
- cd $WEBSITE_NAME/submodules/$CI_PROJECT_NAME - git checkout gitee/main
- git checkout $CI_COMMIT_SHORT_SHA - git merge --no-ff --no-edit origin/main
- echo "Download complete." - git push gitee HEAD:main
- echo "Compiling the code..."
- cd ../..
- npm --registry https://nexus.bianbu.xyz/repository/npmproxy/ install --no-strict-ssl
- bash prepare.sh
- npm run build
- echo "Compile complete."
- mv build ../public
artifacts:
paths:
- public/
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == "main"
- if: $CI_COMMIT_TAG