2021-07-09 08:14:35 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-07-09 09:21:42 +02:00
|
|
|
cd $(dirname $0)
|
|
|
|
|
|
|
|
docker-compose up -d
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
docker-compose exec backup backup
|
|
|
|
|
|
|
|
docker run --rm -it \
|
2021-07-11 13:27:01 +02:00
|
|
|
-v compose_backup_data:/data alpine \
|
2021-07-09 09:21:42 +02:00
|
|
|
ash -c 'tar -xf /data/backup/test.tar.gz && test -f /backup/app_data/offen.db'
|
|
|
|
|
2021-07-11 09:43:16 +02:00
|
|
|
echo "[TEST:PASS] Found relevant files in untared backup."
|
|
|
|
|
2021-07-09 09:57:05 +02:00
|
|
|
if [ "$(docker-compose ps -q | wc -l)" != "3" ]; then
|
2021-07-11 09:43:16 +02:00
|
|
|
echo "[TEST:FAIL] Expected all containers to be running post backup, instead seen:"
|
2021-07-09 09:57:05 +02:00
|
|
|
docker-compose ps
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-07-11 09:43:16 +02:00
|
|
|
echo "[TEST:PASS] All containers running post backup."
|
2021-07-09 09:21:42 +02:00
|
|
|
|
2021-07-11 09:43:16 +02:00
|
|
|
docker-compose down --volumes
|