File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -52,31 +52,37 @@ runs:
52
52
run : |
53
53
set -eo pipefail
54
54
docker run -d --name ${{ inputs.container-name }} -p ${{ inputs.ogmios-port }}:1337 -v ${{ inputs.db-dir }}:/db ${{ steps.docker-image.outputs.image }}
55
- sleep 3
55
+ sleep 10
56
56
URL=http://localhost:$OGMIOS_PORT/health
57
57
echo "Begin synchronization, target: $THRESHOLD"
58
- echo ""
58
+ echo -n ""
59
59
for (( ;; ))
60
60
do
61
61
HEALTH=$(curl -sS $URL)
62
62
NETWORK_SYNCHRONIZATION=$(sed 's/.*"networkSynchronization":\([0-9]\+\.\?[0-9]*\).*/\1/' <<< $HEALTH)
63
63
64
64
RE='^[0-9]+\.?[0-9]*$'
65
65
if ! [[ $NETWORK_SYNCHRONIZATION =~ $RE ]] ; then
66
- echo "error: unexpected response from /health endpoint: $HEALTH"
67
- exit 1
66
+ if [[ $HEALTH == *"\"networkSynchronization\":null"* ]]; then
67
+ echo -ne "\rServer isn't ready..."
68
+ sleep 5
69
+ continue
70
+ else
71
+ echo "error: unexpected response from /health endpoint: $HEALTH"
72
+ exit 1
73
+ fi
68
74
fi
69
75
70
- echo -e "\rnetwork synchronization: $NETWORK_SYNCHRONIZATION"
76
+ echo -ne "\rnetwork synchronization: $NETWORK_SYNCHRONIZATION"
71
77
PREDICATE=$(bc <<< "$NETWORK_SYNCHRONIZATION >= $THRESHOLD")
72
78
73
79
if [ "$PREDICATE" -eq 1 ]; then
80
+ echo "Done."
74
81
exit 0
75
82
else
76
83
sleep 5
77
84
fi
78
85
done
79
- echo -e "\rDone."
80
86
81
87
- name : 🧹 Cleanup
82
88
run : |
You can’t perform that action at this time.
0 commit comments