drone update
continuous-integration/drone Build was killed Details

main
ronnic 2 years ago
parent 43441cff98
commit eea3b81cc1

@ -0,0 +1,47 @@
kind: pipeline
type: docker
name: backup-multiple-configs
trigger:
schedule:
- cron: '0 2 * * 0' # This schedules the job to run at 2 AM every Sunday
steps:
- name: backup-and-encrypt
image: alpine
commands:
- apk add --no-cache openssl tar
- |
for dir in vaultwarden homebox koillection Homepage mealie; do
tar cvf - /backup/$dir | openssl enc -aes-256-cbc -salt -out /backup/${dir}_backup.tar.enc -k $ENCRYPTION_KEY
done
volumes:
- name: config_volumes
path: /backup
environment:
ENCRYPTION_KEY:
from_secret: encryption_key
- name: upload to s3
image: amazon/aws-cli
commands:
- |
for file in /backup/*.tar.enc; do
aws s3 cp $file s3://ronnic-backup/${file#/backup/}
done
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
AWS_DEFAULT_REGION: us-west-1
- name: cleanup
image: alpine
commands:
- rm -f /backup/*.tar.enc
volumes:
- name: config_volumes
host:
path: /home/ronnic/Configs
Loading…
Cancel
Save