2021-06-01 07:55:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# ------------------------------
|
|
|
|
# prints a message as soon as
|
|
|
|
# ZITADEL is ready
|
|
|
|
# ------------------------------
|
|
|
|
|
|
|
|
be_status=""
|
2021-07-27 19:55:30 +00:00
|
|
|
env_status=""
|
|
|
|
console_status=""
|
2021-06-01 07:55:08 +00:00
|
|
|
|
2021-07-27 19:55:30 +00:00
|
|
|
while [[ $be_status != 200 && $env_status != 200 ]]; do
|
2021-06-01 07:55:08 +00:00
|
|
|
sleep 5
|
2021-07-27 19:55:30 +00:00
|
|
|
## This is a workaround for a race condition
|
|
|
|
if [[ $be_status -eq 412 ]]; then
|
|
|
|
echo "please restart the process once again to get rid of the 412 error!"
|
|
|
|
fi
|
2021-06-01 07:55:08 +00:00
|
|
|
be_status=$(curl -s -o /dev/null -I -w "%{http_code}" host.docker.internal:${BE_PORT}/clientID)
|
2021-07-27 19:55:30 +00:00
|
|
|
env_status=$(curl -s -o /dev/null -I -w "%{http_code}" host.docker.internal:${FE_PORT}/assets/environment.json)
|
|
|
|
echo "backend (${be_status}) or environment (${env_status}) not ready yet ==> retrying in 5 seconds"
|
2021-06-01 07:55:08 +00:00
|
|
|
done
|
|
|
|
|
2021-07-27 19:55:30 +00:00
|
|
|
echo "backend and environment.json ready!"
|
|
|
|
|
|
|
|
while [[ $console_status != 200 ]]; do
|
|
|
|
sleep 15
|
|
|
|
console_status=$(curl -s -o /dev/null -I -w "%{http_code}" host.docker.internal:${FE_PORT}/index.html)
|
|
|
|
echo "console (${console_status}) not ready yet ==> retrying in 15 seconds"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "console ready - please wait shortly!"
|
|
|
|
sleep 15
|
|
|
|
|
2021-06-01 07:55:08 +00:00
|
|
|
echo -e "++=======================================================================================++
|
|
|
|
|| ||
|
|
|
|
|| ZZZZZZZZZZZZ II TTTTTTTTTTTT AAAA DDDDDD EEEEEEEEEE LL ||
|
|
|
|
|| ZZ II TT AA AA DD DD EE LL ||
|
|
|
|
|| ZZ II TT AA AA DD DD EE LL ||
|
|
|
|
|| ZZ II TT AA AA DD DD EEEEEEEE LL ||
|
|
|
|
|| ZZ II TT AAAAAAAAAAAA DD DD EE LL ||
|
|
|
|
|| ZZ II TT AA AA DD DD EE LL ||
|
|
|
|
|| ZZZZZZZZZZZZ II TT AA AA DDDDDD EEEEEEEEEE LLLLLLLLLL ||
|
|
|
|
|| ||
|
|
|
|
|| ||
|
|
|
|
|| SSSSSSSSSS TTTTTTTTTTTT AAAA RRRRRRRR TTTTTTTTTTTT EEEEEEEEEE DDDDDD ||
|
|
|
|
|| SS TT AA AA RR RR TT EE DD DD ||
|
|
|
|
|| SS TT AA AA RR RR TT EE DD DD ||
|
|
|
|
|| SSSSSS TT AA AA RRRRRRRR TT EEEEEEEE DD DD ||
|
|
|
|
|| SS TT AAAAAAAAAAAA RRRR TT EE DD DD ||
|
|
|
|
|| SS TT AA AA RR RR TT EE DD DD ||
|
|
|
|
|| SSSSSSSSSS TT AA AA RR RR TT EEEEEEEEEE DDDDDD ||
|
|
|
|
|| ||
|
|
|
|
++=======================================================================================++"
|
2021-07-27 19:55:30 +00:00
|
|
|
|
|
|
|
echo "access the console here http://localhost:${FE_PORT}"
|
|
|
|
echo "access the login here http://localhost:50003/login"
|
|
|
|
echo "access the apis here http://localhost:50002"
|