cigs4/.drone.yml

40 lines
810 B
YAML
Raw Normal View 히스토리

kind: pipeline
type: docker
name: default
steps:
- name: build
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: dockerconfig
path: /root/.docker
commands:
- docker build -t harbor.picaiba.com/kszny/mes-api:1.0.0-cigs4 ./ && docker push harbor.picaiba.com/kszny/mes-api:1.0.0-cigs4
2022-09-15 10:48:36 +08:00
- name: deploy
image: harbor.picaiba.com/tools/kubectl
commands:
- echo "172.27.0.20 lb.kubesphere.local" >> /etc/hosts
- sleep 1
- kubectl scale --replicas=0 deployment/mes-api -n mes-cigs4
2022-09-15 10:48:36 +08:00
- sleep 3
- kubectl scale --replicas=1 deployment/mes-api -n mes-cigs4
2022-09-15 10:48:36 +08:00
depends_on:
- build
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: dockerconfig
host:
path: /root/.docker
trigger:
branch:
- master
event:
- push