mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-10 00:30:29 +01:00
Frederik Ring
aee802cb09
* Run tests in GitHub actions * Do not try to allocate a pseudo TTY when running compose commands * Try hard disabling TTY allocation * Use compose plugin * Test scripts shall not try to allocate a TTY * Pass correct base version * Check whether env var is even needed * Stop running tests in CircleCI * Run releases from GitHub actions as well * Manually construct tags to be pushed on release
38 lines
682 B
Bash
Executable File
38 lines
682 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd $(dirname $0)
|
|
. ../util.sh
|
|
current_test=$(basename $(pwd))
|
|
|
|
docker swarm init
|
|
|
|
docker stack deploy --compose-file=docker-compose.yml test_stack
|
|
|
|
while [ -z $(docker ps -q -f name=backup) ]; do
|
|
info "Backup container not ready yet. Retrying."
|
|
sleep 1
|
|
done
|
|
|
|
sleep 20
|
|
|
|
docker exec $(docker ps -q -f name=backup) backup
|
|
|
|
docker run --rm \
|
|
-v backup_data:/data alpine \
|
|
ash -c 'tar -xf /data/backup/test.tar.gz && test -f /backup/pg_data/PG_VERSION'
|
|
|
|
pass "Found relevant files in untared backup."
|
|
|
|
sleep 5
|
|
expect_running_containers "5"
|
|
|
|
docker stack rm test_stack
|
|
docker swarm leave --force
|
|
|
|
sleep 10
|
|
|
|
docker volume rm backup_data
|
|
docker volume rm pg_data
|