代码拉取完成,页面将自动刷新
image: node:10-alpine
variables:
DEFAULT_CACHE_KEY: "$CI_COMMIT_REF_SLUG"
cache:
key: "$DEFAULT_CACHE_KEY"
paths:
- node_modules/
stages:
- setup
- test
- build
- publish
- notify
setup:
stage: setup
script:
- npm config set always-auth true
- npm config set registry https://repo.sdtdev.net/repository/npm-public/
- npm config set //repo.sdtdev.net/repository/npm-public/:_authToken ${NPM_AUTH_TOKEN}
- "[ -f yarn.lock ] && sed -i 's$r.sdt-int.com$repo.sdtdev.net$g' yarn.lock"
- yarn --prefer-offline --no-progress --non-interactive --frozen-lockfile
lint:
stage: test
cache:
key: "$DEFAULT_CACHE_KEY"
paths:
- node_modules/
policy: pull
script:
- yarn run lint -- --quiet
intl:
stage: test
cache:
key: "$DEFAULT_CACHE_KEY"
paths:
- node_modules/
policy: pull
script:
- yarn run intl -- --test
.build: &build_template
stage: build
cache:
key: "$DEFAULT_CACHE_KEY"
paths:
- node_modules/
policy: pull
script:
- yarn run build
develop_build:
<<: *build_template
only:
- branches
except:
- master
artifacts:
expire_in: 1 day
paths:
- lib/
master_build:
<<: *build_template
only:
- master
- tags
artifacts:
expire_in: 1 month
paths:
- lib/
.yarn: &yarn_publish
stage: publish
cache: {}
before_script:
- npm config set registry https://repo.sdtdev.net/repository/npm-hosted/
- npm config set //repo.sdtdev.net/repository/npm-hosted/:_authToken ${NPM_AUTH_TOKEN}
- npm config set email $GITLAB_USER_EMAIL
develop_publish:
<<: *yarn_publish
only:
- develop
script:
- yarn publish --new-version $(node -pe "require('./package.json').version")-alpha.$CI_PIPELINE_ID --strict-semver --no-git-tag-version
master_publish:
<<: *yarn_publish
only:
- tags
script:
- "yarn publish --new-version ${CI_COMMIT_TAG#v} --strict-semver --no-git-tag-version"
web_main_pipeline:
stage: notify
only:
- develop
cache: {}
image: zerda/alpine-curl:3.6
dependencies:
- develop_publish
variables:
REF_NAME: develop
script:
- curl --silent --show-error --fail -X POST -d token=${WEB_MAIN_PIPELINE_TOKEN} -d ref=${REF_NAME} https://gitlab.sdtdev.net/api/v4/projects/${WEB_MAIN_PROJECT_ID}/trigger/pipeline
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。