build: :新增自动构建部署
Tento commit je obsažen v:
rodič
645f82b466
revize
8ff16edec0
41
.drone.yml
Normální soubor
41
.drone.yml
Normální soubor
@ -0,0 +1,41 @@
|
||||
---
|
||||
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 --add-host github.com:192.30.255.113 -t harbor.picaiba.com/kszny/cnbmai:1.0.0 ./ && docker push harbor.picaiba.com/kszny/cnbmai:1.0.0
|
||||
|
||||
- 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/cnbmai -n cnbmai
|
||||
- sleep 3
|
||||
- kubectl scale --replicas=1 deployment/cnbmai -n cnbmai
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
- name: dockerconfig
|
||||
host:
|
||||
path: /root/.docker
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- projects/rcdhg
|
||||
event:
|
||||
- push
|
10
Dockerfile
Normální soubor
10
Dockerfile
Normální soubor
@ -0,0 +1,10 @@
|
||||
FROM node:12 AS builder
|
||||
WORKDIR /app
|
||||
ADD package.json /app/
|
||||
RUN npm config set registry https://registry.npmmirror.com && npm install
|
||||
ADD . /app
|
||||
RUN npm run build
|
||||
|
||||
FROM busybox
|
||||
LABEL maintainer thomas.hairong@gmail.com
|
||||
COPY --from=builder /app/dist /html
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele