mikrotik
All checks were successful
ci/woodpecker/push/upload Pipeline was successful

This commit is contained in:
Adora Laura Kalb 2024-08-21 11:47:21 +02:00
parent 9ac12f7c39
commit 7caba9b5c5
Signed by: adoralaura
SSH key fingerprint: SHA256:3XrkbR8ikAZJVtYfaUliX1MhmJYVAe/ocIb/MiDHBJ8
2 changed files with 198 additions and 7 deletions

View file

@ -2,19 +2,23 @@ when:
event: push
branch: main
variables:
- &SSH_PORT '2003'
steps:
upload:
image: alpine:latest
secrets:
- SSH_KEY
- TARGET_SERVER
- TARGET_USER
- RSYNC_SSHKEY
- RSYNC_TARGET_SERVER
- RSYNC_TARGET_USER
environment:
- TARGET_PATH=/webroot/web-archive.lauka.net
TARGET_PATH: /webroot/web-archive.lauka.net
RSYNC_TARGET_PORT: *SSH_PORT
commands:
- apk add --update --no-cache openssh rsync git
- mkdir -p $HOME/.ssh
- echo "$SSH_KEY" > $HOME/.ssh/id_ed25519
- echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519
- chmod 0600 $HOME/.ssh/id_ed25519
- ssh-keyscan -t ed25519 $TARGET_SERVER >> $HOME/.ssh/known_hosts
- rsync -avh --delete ./ $TARGET_USER@$TARGET_SERVER:$TARGET_PATH --exclude 'readme.md' --exclude '.woodpecker' --exclude '.git'
- ssh-keyscan -t ed25519 -p $RSYNC_TARGET_PORT $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
- rsync -avh -e "ssh -p $RSYNC_TARGET_PORT" --delete ./ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH --exclude 'readme.md' --exclude '.woodpecker' --exclude '.git'

File diff suppressed because one or more lines are too long