copy old site
continuous-integration/drone/push Build is passing Details

This commit is contained in:
ktyl 2022-09-27 22:52:04 +01:00
parent 42033294db
commit 4065731ad5
1 changed files with 16 additions and 1 deletions

View File

@ -34,6 +34,9 @@ steps:
from_secret: user from_secret: user
SSH_KEY: SSH_KEY:
from_secret: ssh_key from_secret: ssh_key
HOST_DIR: "/var/www/${HOST}"
BACKUP_DIR: "~/backups/$${HOST}/$${HOST}-$${DRONE_STAGE_STARTED}"
when: when:
branch: branch:
- drone - drone
@ -52,7 +55,19 @@ steps:
- echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
# run operations on remote host # run operations on remote host
- ssh "$${USER}@$${HOST}" "neofetch" - host="$${USER}@$${HOST}"
- host_dir="/var/www/$${HOST}"
- ls_host_dir="ls $host_dir"
- 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
#- ssh "$${USER}@$${HOST}" "[[ ! -d ~/gemini/content ]] || rm -r ~/gemini/content" #- ssh "$${USER}@$${HOST}" "[[ ! -d ~/gemini/content ]] || rm -r ~/gemini/content"
#- rsync -rP content "$${USER}@$${HOST}:gemini" #- rsync -rP content "$${USER}@$${HOST}:gemini"