mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-10 00:30:29 +01:00
Local directory can be used instead of volume for storing test artifact (#204)
This commit is contained in:
parent
c177202ac1
commit
808cf8f82d
@ -42,10 +42,9 @@ services:
|
|||||||
EXEC_LABEL: test
|
EXEC_LABEL: test
|
||||||
EXEC_FORWARD_OUTPUT: "true"
|
EXEC_FORWARD_OUTPUT: "true"
|
||||||
volumes:
|
volumes:
|
||||||
- archive:/archive
|
- ./local:/archive
|
||||||
- app_data:/backup/data:ro
|
- app_data:/backup/data:ro
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
app_data:
|
app_data:
|
||||||
archive:
|
|
||||||
|
@ -6,11 +6,12 @@ cd $(dirname $0)
|
|||||||
. ../util.sh
|
. ../util.sh
|
||||||
current_test=$(basename $(pwd))
|
current_test=$(basename $(pwd))
|
||||||
|
|
||||||
|
mkdir -p ./local
|
||||||
|
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
sleep 30 # mariadb likes to take a bit before responding
|
sleep 30 # mariadb likes to take a bit before responding
|
||||||
|
|
||||||
docker compose exec backup backup
|
docker compose exec backup backup
|
||||||
sudo cp -r $(docker volume inspect --format='{{ .Mountpoint }}' commands_archive) ./local
|
|
||||||
|
|
||||||
tar -xvf ./local/test.tar.gz
|
tar -xvf ./local/test.tar.gz
|
||||||
if [ ! -f ./backup/data/dump.sql ]; then
|
if [ ! -f ./backup/data/dump.sql ]; then
|
||||||
@ -34,6 +35,7 @@ sudo rm -rf ./local
|
|||||||
|
|
||||||
info "Running commands test in swarm mode next."
|
info "Running commands test in swarm mode next."
|
||||||
|
|
||||||
|
mkdir -p ./local
|
||||||
docker swarm init
|
docker swarm init
|
||||||
|
|
||||||
docker stack deploy --compose-file=docker-compose.yml test_stack
|
docker stack deploy --compose-file=docker-compose.yml test_stack
|
||||||
@ -47,8 +49,6 @@ sleep 20
|
|||||||
|
|
||||||
docker exec $(docker ps -q -f name=backup) backup
|
docker exec $(docker ps -q -f name=backup) backup
|
||||||
|
|
||||||
sudo cp -r $(docker volume inspect --format='{{ .Mountpoint }}' test_stack_archive) ./local
|
|
||||||
|
|
||||||
tar -xvf ./local/test.tar.gz
|
tar -xvf ./local/test.tar.gz
|
||||||
if [ ! -f ./backup/data/dump.sql ]; then
|
if [ ! -f ./backup/data/dump.sql ]; then
|
||||||
fail "Could not find file written by pre command."
|
fail "Could not find file written by pre command."
|
||||||
|
Loading…
Reference in New Issue
Block a user