60 строки
1.1 KiB
YAML
60 строки
1.1 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: build
|
|
image: node:16-alpine
|
|
pull: if_not_exists
|
|
environment:
|
|
NODE_ENV: ""
|
|
commands:
|
|
#- yarn install --frozen-lockfile
|
|
- yarn install
|
|
- env ${NODE_ENV} yarn build:prod
|
|
|
|
- name: publish
|
|
image: docker:dind
|
|
pull: if_not_exists
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run/docker.sock
|
|
- name: dockerconfig
|
|
path: /root/.docker
|
|
commands:
|
|
- docker build -t hub.kszny.picaiba.com/kszny/xcac-ui ./
|
|
- docker push hub.kszny.picaiba.com/kszny/xcac-ui
|
|
depends_on:
|
|
- build
|
|
|
|
- name: deploy
|
|
image: appleboy/drone-ssh
|
|
pull: if-not-exists
|
|
settings:
|
|
host:
|
|
- 172.24.145.74
|
|
username: root
|
|
password: Root@123
|
|
port: 22
|
|
command_timeout: 2m
|
|
script:
|
|
- docker pull hub.kszny.picaiba.com/kszny/xcac-ui
|
|
- docker run --rm -v /data/www/xcac:/tmp hub.kszny.picaiba.com/kszny/xcac-ui sh -c "rm -rf /tmp/* && mv -f /html /tmp"
|
|
depends_on:
|
|
- publish
|
|
|
|
volumes:
|
|
- name: dockersock
|
|
host:
|
|
path: /var/run/docker.sock
|
|
- name: dockerconfig
|
|
host:
|
|
path: /root/.docker
|
|
|
|
trigger:
|
|
branch:
|
|
- projects/mesxc-test
|
|
event:
|
|
- push
|