提交 7f10dedd 作者: 王南南

更新 .gitlab-ci.yml

上级 5b93ad06
流水线 #38557 已失败 于阶段
in 9 秒
stages:
- build
- deploy
cache: cache:
paths: paths:
- node_modules/ - node_modules/ # Node modules and dependencies
pages:
variables:
PORT: "4000"
LAN_REPO: registry-vpc.cn-beijing.aliyuncs.com
WAN_REPO: registry.cn-beijing.aliyuncs.com
DEV_REPO: qianjia_dev
PRED_REPO: qianjia_pred
PROD_REPO: qianjia_prod
# dev分支
build_push_image_dev_job:
image: registry.cn-beijing.aliyuncs.com/qianjia_public/mygitbook
stage: build
before_script:
- docker login --username=$USERNAME --password=$PASSWORD registry-vpc.cn-beijing.aliyuncs.com
- CONTAINER_NAME=`echo $CI_PROJECT_NAME | tr 'A-Z' 'a-z'| tr '_' '-'`
- TAG=`expr substr $CI_COMMIT_SHA 1 8`
script:
- docker build -t $LAN_REPO/$DEV_REPO/$CONTAINER_NAME:$TAG -f Dockerfile .
- docker push $LAN_REPO/$DEV_REPO/$CONTAINER_NAME:$TAG
tags:
- k8s
only:
- dev
when: on_success
deploy_to_dev_job:
image: registry-vpc.cn-beijing.aliyuncs.com/qianjia2018/qianjia_public:mvn-docker-kube
stage: deploy stage: deploy
before_script: image: registry-vpc.cn-beijing.aliyuncs.com/qianjia_public:mygitbook
- CONTAINER_NAME=`echo $CI_PROJECT_NAME | tr 'A-Z' 'a-z'| tr '_' '-'`
- TAG=`expr substr $CI_COMMIT_SHA 1 8`
script: script:
- bash ~/.local/bin/f200.sh $CONTAINER_NAME $PORT 80 $WAN_REPO/$DEV_REPO/$CONTAINER_NAME:$TAG guojia 192.168.10.200 - gitbook build . public # build to public path
tags: artifacts:
- ssh-deploy paths:
- public
expire_in: 1 week
only: only:
- dev - master
when: on_success tags:
- k8s
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论