From 410e4b39745b7510cd986ea1209e7357334f5f8d Mon Sep 17 00:00:00 2001 From: ktyl Date: Tue, 27 Sep 2022 22:52:04 +0100 Subject: [PATCH] copy old site --- .drone.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index f1ce75c..5efb0b6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,6 +34,9 @@ steps: from_secret: user SSH_KEY: from_secret: ssh_key + HOST_DIR: "/var/www/${HOST}" + BACKUP_DIR: "~/backups/${HOST}/${HOST}-${DRONE_STAGE_STARTED}" + when: branch: - drone @@ -52,7 +55,17 @@ steps: - echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config # run operations on remote host - - ssh "$${USER}@$${HOST}" "neofetch" + - host="$${USER}@$${HOST}" + + - ssh $host "ls $HOST_DIR" + - ssh $host "mkdir -p $BACKUP_DIR" + - ssh $host "rsync -rP $HOST_DIR/* $BACKUP_DIR" + + #- ssh $host 'echo "$host_dir -> $backup_dir"' + #- ssh $host "mkdir -p $backup_dir" + #- ssh $host "rsync -rP /var/www/${HOST}/* ${DRONE_STAGE_STARTED}" + #- ssh $host "ls site" + #- ssh #- ssh "$${USER}@$${HOST}" "[[ ! -d ~/gemini/content ]] || rm -r ~/gemini/content" #- rsync -rP content "$${USER}@$${HOST}:gemini"