mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-10 00:30:29 +01:00
8dfdd14527
* Added custom notification messages using text/template * Change notification template path and removed automatic newline trim * Added stats and changed structure of template params * Stat file hotfix * Embedded and fixed default notification templates Fix * Changed Output to LogOutput * Changed stats integer to unsigned * Bytes formatting in template func fix * Changed Archives to Storages * Removed unecessary sleep for pruning leeway * Set EndTime after pruning is completed * Added custom notifications documentation * Added 5s sleep in swarm test * Fixed documentation * Dockerfile copies all files in cmd/backup
38 lines
797 B
Bash
Executable File
38 lines
797 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd $(dirname $0)
|
|
|
|
docker swarm init
|
|
|
|
docker stack deploy --compose-file=docker-compose.yml test_stack
|
|
|
|
while [ -z $(docker ps -q -f name=backup) ]; do
|
|
echo "[TEST:INFO] Backup container not ready yet. Retrying."
|
|
sleep 1
|
|
done
|
|
|
|
sleep 20
|
|
|
|
docker exec $(docker ps -q -f name=backup) backup
|
|
|
|
docker run --rm -it \
|
|
-v test_stack_backup_data:/data alpine \
|
|
ash -c 'tar -xf /data/backup/test.tar.gz && test -f /backup/pg_data/PG_VERSION'
|
|
|
|
echo "[TEST:PASS] Found relevant files in untared backup."
|
|
|
|
sleep 5
|
|
if [ "$(docker ps -q | wc -l)" != "5" ]; then
|
|
echo "[TEST:FAIL] Expected all containers to be running post backup, instead seen:"
|
|
docker ps -a
|
|
exit 1
|
|
fi
|
|
|
|
echo "[TEST:PASS] All containers running post backup."
|
|
|
|
docker stack rm test_stack
|
|
|
|
docker swarm leave --force
|