docker-postgis/scenario_tests/collations/test.sh

38 wiersze
652 B
Bash

#!/usr/bin/env bash
# exit immediately if test fails
set -e
source ../test-env.sh
# Run service
if [[ $(dpkg -l | grep "docker-compose") > /dev/null ]];then
VERSION='docker-compose'
else
VERSION='docker compose'
fi
${VERSION} up -d
2021-01-27 19:42:40 +00:00
if [[ -n "${PRINT_TEST_LOGS}" ]]; then
${VERSION} logs -f &
2021-01-27 19:42:40 +00:00
fi
sleep 30
services=("pg" "pg-new" "pg-gosu" "pg-new-gosu")
for service in "${services[@]}"; do
# Execute tests
until ${VERSION} exec -T $service pg_isready; do
sleep 30
2021-01-27 19:42:40 +00:00
echo "Wait service to be ready"
done;
2021-01-27 19:42:40 +00:00
echo "Execute test for $service"
${VERSION} exec -T $service /bin/bash /tests/test.sh
done
${VERSION} down -v