1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- kind: pipeline
- type: docker
- name: default
- steps:
- - name: install-node
- image: node:16.12.2
- commands:
- - npm config set registry https://registry.npmmirror.com
- - yarn config set registry https://registry.npmmirror.com
- - yarn config list
- - 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
|