From 8001c6bc363dc99dc5973d8a01fd76bc49bb1d58 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 27 Jan 2019 16:39:32 +0100 Subject: [PATCH] build better deployment pipeline to prevent downtimes --- .drone.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.drone.yml b/.drone.yml index 42cd669..40530ec 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,6 +26,22 @@ steps: branch: [ master ] event: [ push ] + - name: freeze + image: appleboy/drone-ssh + settings: + host: + from_secret: ssh_host + username: + from_secret: ssh_username + key: + from_secret: ssh_key + script: + - cp -R /var/www/virtual/geeklab/html/geeklabor.de/ /var/www/virtual/geeklab/html/geeklabor_freeze/ + - ln -s /var/www/virtual/geeklab/html/geeklabor_freeze /var/www/virtual/geeklab/geeklabor.de + when: + branch: [ master ] + event: [ push ] + - name: publish image: appleboy/drone-scp settings: @@ -43,6 +59,22 @@ steps: branch: [ master ] event: [ push ] + - name: cleanup + image: appleboy/drone-ssh + settings: + host: + from_secret: ssh_host + username: + from_secret: ssh_username + key: + from_secret: ssh_key + script: + - ln -s /var/www/virtual/geeklab/html/geeklabor.de /var/www/virtual/geeklab/geeklabor.de + - rm -rf /var/www/virtual/geeklab/html/geeklabor_freeze/ + when: + branch: [ master ] + event: [ push ] + - name: notify image: plugins/matrix settings: