File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 - name : Set up Docker Buildx
2020 uses : docker/setup-buildx-action@v3
2121
22- - name : Build Docker Compose
23- run : docker compose --profile monitoring build
22+ - name : Build and Start Docker Compose
23+ run : |
24+ docker compose --profile monitoring build
25+ docker compose --profile monitoring up -d
26+
27+ - name : Wait for bitcoin-node to be healthy
28+ run : |
29+ chmod +x docker/wait-for-bitcoin-healthy.sh
30+ docker/wait-for-bitcoin-healthy.sh
31+
32+ - name : Stop Docker Compose
33+ run : |
34+ docker compose down -v
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " Waiting for bitcoin-node to be healthy..."
4+ TIMEOUT=60
5+ INTERVAL=6
6+ ELAPSED=0
7+
8+ while [ $ELAPSED -lt $TIMEOUT ]; do
9+ HEALTH=$( docker container inspect -f ' {{.State.Health.Status}}' peer-observer-docker-bitcoin-node-1)
10+ if [ " $HEALTH " = " healthy" ]; then
11+ echo " bitcoin-node is healthy!"
12+ exit 0
13+ fi
14+
15+ echo " Current health status: $HEALTH "
16+ sleep $INTERVAL
17+ ELAPSED=$(( ELAPSED + INTERVAL))
18+ done
19+
20+ echo " bitcoin-node failed to become healthy within $TIMEOUT seconds."
21+ docker compose logs bitcoin-node
22+ exit 1
You can’t perform that action at this time.
0 commit comments