提交 b41d7372 作者: 闫冬杰

更新 .gitlab-ci.yml

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