-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-tests.sh
More file actions
executable file
·27 lines (21 loc) · 1.19 KB
/
Copy pathrun-tests.sh
File metadata and controls
executable file
·27 lines (21 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
# Force PAGES_DIR to this project's pages so tests always get the right volume,
# regardless of any PAGES_DIR set in the caller's environment.
export PAGES_DIR="$(pwd)/test-pages"
# ── Build images ──────────────────────────────────────────────────────────────
echo "Building images..."
docker compose build smth test
# ── (Re)start smth so it runs the freshly built image ─────────────────────────
echo "Starting smth..."
docker compose up -d --force-recreate smth
echo "Waiting for smth to be healthy..."
elapsed=0
until docker compose ps smth | grep -q "healthy"; do
sleep 2; elapsed=$((elapsed + 2))
if [ $elapsed -ge 60 ]; then echo "Timed out waiting for smth"; exit 1; fi
done
# ── Run tests ─────────────────────────────────────────────────────────────────
echo "Running tests..."
docker compose --profile test run --rm test