stages: - build build_master: #正式包 stage: build only: - master - /^release\/.*$/ tags: - PromotionFE script: - export version=`cat package.json|awk -F "[:]" '/"version"/{print$2}'` - export version=${version:2:$[${#version}-4]} - if [ $CI_COMMIT_REF_NAME == "master" ] && [ $(echo $version | grep -v -E "r|t" ) != "" ]; then echo "正常发包"; else exit 0; fi - cnpm i - npm run build - rm dist/*.html - rm dist/*.common.js - rm dist/*.umd.js - cnpm publish - node publish.js build_test: #测试包 stage: build only: - /^feature\/.*$/ - /^bug-hotfix\/.*$/ - /^fix\/.*$/ tags: - PromotionFE script: - cnpm i - npm run build - cnpm publish --registry=http://111.230.199.61:6888/