Add housekeep task to delete the previous files before deployment.

This commit is contained in:
Kazuhiro MUSASHI 2020-01-19 17:13:18 +08:00
parent cc75c68842
commit b65d5c07bd
1 changed files with 11 additions and 0 deletions

View File

@ -60,6 +60,17 @@ steps:
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done
- name: housekeep
image: appleboy/drone-ssh
settings:
host: 10.0.1.166
username: webadm
port: 10022
key:
from_secret: ssh_key
script:
- rm -rf /var/www/test/*
- name: scp - name: scp
image: appleboy/drone-scp image: appleboy/drone-scp
settings: settings: