12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- kind: pipeline
- type: docker
- name: default
- steps:
- - name: install-node
- image: node:16.10.0
- commands:
- - npm config set registry https://registry.npmmirror.com
- - yarn config set registry https://registry.npmmirror.com
- - yarn config list
- - yarn config set proxy http://192.168.1.5:10809 -g
- - yarn config set https-proxy http://192.168.1.5:10809 -g
- - yarn install
- - yarn build:test
- - name: zip-dist
- image: alpine:3.12
- commands:
- - apk add zip
- - zip -r dist.zip dist
- - name: push
- image: appleboy/drone-scp
- settings:
- host:
- from_secret: TestServerIP
- port:
- from_secret: Port
- username: root
- password:
- from_secret: TestServerPwd
- command_timeout: 3m
- target: /opt/docker/other/nginx/html/
- source:
- - dist.zip
- status:
- - success
- - name: deploy
- image: appleboy/drone-ssh
- settings:
- host:
- from_secret: TestServerIP
- username: root
- password:
- from_secret: TestServerPwd
- port:
- from_secret: Port
- script:
- - 'cd /opt/docker/other/nginx/html'
- - 'unzip dist.zip'
- - 'rm -rf dist.zip'
- - 'rm -rf admin'
- - 'mv dist admin'
- - 'docker exec nginx nginx -s reload'
- status:
- - success
- trigger:
- branch:
- - 2.0
- event:
- - push
|