File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build Monitoring Container
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ branches :
9+ - master
10+
11+ jobs :
12+ test-docker-compose :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v3
21+
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 @@ -6,7 +6,7 @@ case "$BITCOIN_NETWORK" in
66 mainnet) NETWORK=" " ;;
77 signet) NETWORK=" -signet" ;;
88 testnet) NETWORK=" -testnet" ;;
9- regtest|" " ) NETWORK=" -regtest" ;; regtest is the default
9+ regtest|" " ) NETWORK=" -regtest" ;; # regtest is the default
1010 * )
1111 echo " Unknown BITCOIN_NETWORK: $BITCOIN_NETWORK "
1212 exit 1
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