提交 b41d7372 作者: 闫冬杰

更新 .gitlab-ci.yml

上级 0308d4cb
流水线 #2016 已失败 于阶段
in 1 分 45 秒
variables:
DOCKER_DRIVER: overlay2
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- node_modules
# cache:
# key: "$CI_COMMIT_REF_NAME"
# paths:
# - node_modules
stages:
- compile
- build
- deploy
- compile
- build
- deploy
compile:
stage: compile
image: node:9
script:
- npm config set registry https://registry.npm.taobao.org
- npm install
- npm run build
artifacts:
expire_in: 15 mins
paths:
- dist
stage: compile
image: node:9
script:
- npm config set registry https://registry.npm.taobao.org
- npm install --unsafe-perm
- npm run build:prod
artifacts:
expire_in: 15 mins
paths:
- dist
cache:
paths:
- node_modules
build:
stage: build
image: docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY_URL
- docker build -t $CI_REGISTRY_URL/platform/lanzhou-transportation:1.0
- docker push $CI_REGISTRY_URL/platform/lanzhou-transportation:1.0
only:
- master
stage: build
image: docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY_URL
- docker build -t $CI_REGISTRY_URL/platform/lanzhou-transportation:1.0
- docker push $CI_REGISTRY_URL/platform/lanzhou-transportation:1.0
only:
- master
deploy:
stage: deploy
image: $CI_REGISTRY_URL/library/rancher-gitlab-deploy
script:
- upgrade --environment sl-prod --stack slweb --service lanzhou-transportation --new-image $CI_REGISTRY_URL/platform/lanzhou-transportation:1.0 --finish-upgrade
# - upgrade --environment dev --stack slweb --service lanzhou-transportation --new-image $CI_REGISTRY_URL/platform/lanzhou-transportation --finish-upgrade
only:
- master
stage: deploy
image: $CI_REGISTRY_URL/library/rancher-gitlab-deploy
script:
- upgrade --environment sl-prod --stack slweb --service lanzhou-transportation --new-image $CI_REGISTRY_URL/platform/lanzhou-transportation:1.0 --finish-upgrade
only:
- master
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论