forked from archetech/archon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-node-ci
More file actions
executable file
·38 lines (29 loc) · 791 Bytes
/
start-node-ci
File metadata and controls
executable file
·38 lines (29 loc) · 791 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
set -e
source .env
echo $ARCHON_GATEKEEPER_URL
docker compose down
docker compose build cli gatekeeper keymaster ipfs redis mongodb
docker compose up -d cli
echo "Waiting for all services to be 'Up'..."
MAX_RETRIES=30
RETRY_INTERVAL=5
RETRY_COUNT=0
while true; do
# Count total services defined
TOTAL_SERVICES="6"
# Count lines with 'Up' in status
UP_COUNT=$(docker compose ps | grep 'Up' | wc -l)
if [[ "$UP_COUNT" -eq "$TOTAL_SERVICES" ]]; then
echo "✅ All containers are 'Up'"
break
fi
if [[ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]]; then
echo "❌ Timed out waiting for containers to be 'Up'"
docker compose ps
exit 1
fi
echo "⏳ Waiting... ($RETRY_COUNT/$MAX_RETRIES)"
sleep "$RETRY_INTERVAL"
((RETRY_COUNT++))
done