2023-06-13 16:23:52 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-06-14 08:07:49 +02:00
|
|
|
# Wait for Temporal to be ready
|
2023-06-13 16:23:52 +02:00
|
|
|
SECONDS=0
|
2023-06-14 08:07:49 +02:00
|
|
|
TIMEOUT=180
|
2023-06-13 16:23:52 +02:00
|
|
|
|
2023-06-14 08:07:49 +02:00
|
|
|
# Check Temporal by just checking that the port is open
|
2023-06-13 16:23:52 +02:00
|
|
|
while true; do
|
2023-06-14 08:07:49 +02:00
|
|
|
if nc -z localhost 7233; then
|
|
|
|
echo "Temporal is up!"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $SECONDS -ge $TIMEOUT ]; then
|
2024-04-16 17:51:23 +02:00
|
|
|
echo "Timed out ($TIMEOUT sec) waiting for Temporal to be ready. Crossing fingers and trying to run tests anyway."
|
|
|
|
exit 0
|
2023-06-13 16:23:52 +02:00
|
|
|
fi
|
2023-06-14 08:07:49 +02:00
|
|
|
|
|
|
|
echo "Waiting for Temporal to be ready"
|
|
|
|
sleep 1
|
2023-06-13 16:23:52 +02:00
|
|
|
done
|