42 行
845 B
YAML
42 行
845 B
YAML
---
|
|
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/mes/mes-cigs-ui ./ && docker push harbor.picaiba.com/mes/mes-cigs-ui
|
|
|
|
- name: deploy
|
|
image: harbor.picaiba.com/tools/kubectl:1.19.8
|
|
commands:
|
|
- echo "172.27.0.20 lb.kubesphere.local" >> /etc/hosts
|
|
#- echo "52.74.223.119 github.com" >> /etc/hosts
|
|
- sleep 1
|
|
- kubectl scale --replicas=0 deployment/mes-ui -n mes-cigs
|
|
- sleep 3
|
|
- kubectl scale --replicas=1 deployment/mes-ui -n mes-cigs
|
|
depends_on:
|
|
- build
|
|
|
|
volumes:
|
|
- name: dockersock
|
|
host:
|
|
path: /var/run/docker.sock
|
|
- name: dockerconfig
|
|
host:
|
|
path: /root/.docker
|
|
|
|
trigger:
|
|
branch:
|
|
- develop
|
|
event:
|
|
- push
|