test.sh 520 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. set -eo pipefail
  3. export VERSION=$GITHUB_COMMIT-test
  4. export KO_DOCKER_REPO=ko.local
  5. set -u
  6. source ../lib/lib.sh
  7. build_anubis_ko
  8. docker compose up -d
  9. attempt=1
  10. max_attempts=5
  11. delay=2
  12. while ! docker compose ps | grep healthy; do
  13. if (( attempt >= max_attempts )); then
  14. echo "Service did not become healthy after $max_attempts attempts."
  15. exit 1
  16. fi
  17. echo "Waiting for healthy service... attempt $attempt"
  18. sleep $delay
  19. delay=$(( delay * 2 ))
  20. attempt=$(( attempt + 1 ))
  21. done
  22. exit 0