Files
docker-autoheal/tests/tests.sh
T
Andreas Perhab da333f55b1 enable tests to use unique project and autoheal labels for CI
on CI servers where multiple docker containers run we might not
want to restart docker containers from other builds running in
parallel
2021-03-02 08:18:45 +01:00

20 lines
574 B
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
COMPOSE_PROJECT_NAME=${1:-autoheal-test}
export COMPOSE_PROJECT_NAME
function cleanup()
{
exit_status=$?
echo "exit was $exit_status"
# stop autoheal first, to stop it restarting the test containers while we try to stop them
docker-compose stop autoheal
docker-compose -f docker-compose.autoheal.yml -f docker-compose.yml down || true
exit "$exit_status"
}
trap cleanup EXIT
docker-compose up --build -d
docker-compose -f docker-compose.autoheal.yml up --build --exit-code-from watch-autoheal watch-autoheal