2023-08-02 20:59:59 +00:00
|
|
|
#! /bin/bash
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
mkdir -p ./repo ./data
|
|
|
|
|
|
|
|
echo Clean everything
|
|
|
|
docker-compose down -v
|
|
|
|
rm -fr ./repo/* ./data/*
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
echo Boostrap databases and data
|
2023-08-02 22:05:04 +00:00
|
|
|
docker-compose up -d mysql postgres
|
2023-08-02 20:59:59 +00:00
|
|
|
docker-compose run bootstrap
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
echo Run backup job
|
|
|
|
docker-compose run main -backup IntegrationTest -once /test-backup.hcl
|
|
|
|
|
|
|
|
echo Clean data
|
|
|
|
docker-compose down -v
|
2023-08-02 22:05:04 +00:00
|
|
|
docker-compose up -d mysql postgres
|
2023-08-02 20:59:59 +00:00
|
|
|
rm -fr ./data/*
|
2023-08-02 22:05:04 +00:00
|
|
|
sleep 15
|
2023-08-02 20:59:59 +00:00
|
|
|
|
|
|
|
echo Run restore
|
|
|
|
docker-compose run main -restore IntegrationTest -once /test-backup.hcl
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
echo Validate data
|
|
|
|
docker-compose run validate
|
|
|
|
|
|
|
|
echo Clean all again
|
|
|
|
docker-compose down -v
|
|
|
|
rm -fr ./repo/* ./data/*
|