代码拉取完成,页面将自动刷新
before_script:
- env
- pwd
- which node
- node -v
- yarn -v
- whoami
- export SDK_ENV=${SDK_ENV-dev}
stages:
- install
- execute
- deploy
- production
cache:
paths:
- dist
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: "2"
打包:
stage: execute
cache:
paths:
- dist
- node_modules
only:
refs:
- develop
- /^release\/*/
script:
- |
{
if [[ ! -z $BRANCH ]];
then
git checkout $BRANCH
git pull
fi
}
- echo $SDK_ENV
- export SASS_BINARY_SITE=http://npm.mirrors.dg.com/dist/node-sass
- yarn install --registry=http://npm.mirrors.dg.com
- |
{
if [[ $CI_BUILD_REF_NAME =~ 'release/' ]]; then
echo '生产构建'
npm run build:prod
else
npm run build:test
fi
export NOTIFY_TEXT="SUCCESS 🤡🤡🤡"
export NOTIFY_COLOR="info"
} || {
export NOTIFY_TEXT="FAIL 😭😭😭"
export NOTIFY_COLOR="warning"
}
- "curl rsync-cache-server.default.svc.cluster.local/ystReport.sh | bash"
tags:
- linux
生产产物:
stage: production
only:
refs:
- /^release\/*/
when: on_success
script:
- export DEPLOY_NAME=$DEPLOY_NAME
- |
{
if [[ -z $DEPLOY_NAME ]]; then
export DEPLOY_NAME=$CI_PROJECT_NAME
fi
}
- mv dist $DEPLOY_NAME
artifacts:
name: "$DEPLOY_NAME-$CI_COMMIT_REF_SLUG"
paths:
- $DEPLOY_NAME
expire_in: 1 week
tags:
- linux
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。