allow local storage of backups

This commit is contained in:
Frederik Ring
2021-08-19 09:25:53 +02:00
parent 4b59089e3d
commit 767c21ef65
6 changed files with 74 additions and 19 deletions

1
test/compose/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
local

View File

@@ -26,6 +26,7 @@ services:
BACKUP_FILENAME: test.tar.gz
BACKUP_CRON_EXPRESSION: 0 0 5 31 2 ?
volumes:
- ./local:/archive
- app_data:/backup/app_data:ro
- /var/run/docker.sock:/var/run/docker.sock

View File

@@ -4,6 +4,8 @@ set -e
cd $(dirname $0)
mkdir -p local
docker-compose up -d
sleep 5
@@ -13,7 +15,11 @@ docker run --rm -it \
-v compose_backup_data:/data alpine \
ash -c 'tar -xf /data/backup/test.tar.gz && test -f /backup/app_data/offen.db'
echo "[TEST:PASS] Found relevant files in untared backup."
echo "[TEST:PASS] Found relevant files in untared remote backup."
tar -xf ./local/test.tar.gz -C /tmp && test -f /tmp/backup/app_data/offen.db
echo "[TEST:PASS] Found relevant files in untared local backup."
if [ "$(docker-compose ps -q | wc -l)" != "3" ]; then
echo "[TEST:FAIL] Expected all containers to be running post backup, instead seen:"