2021-06-01 09:55:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# ------------------------------
|
|
|
|
# sets the client id in environment.json
|
|
|
|
# ------------------------------
|
|
|
|
|
|
|
|
clientid=""
|
|
|
|
while [ -z $clientid ]; do
|
2021-07-27 21:55:30 +02:00
|
|
|
echo "no from zitadel ==> retrying in 5 seconds"
|
|
|
|
sleep 5
|
2021-06-01 09:55:08 +02:00
|
|
|
clientid=$(curl -s http://${HOST}:${PORT}/clientID)
|
|
|
|
if [[ "$clientid" != *@zitadel* ]]; then
|
2021-07-27 21:55:30 +02:00
|
|
|
echo "invalid response from zitadel ==> retrying in 5 seconds"
|
2021-06-01 09:55:08 +02:00
|
|
|
clientid=""
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "$(jq ".clientid = $clientid" /environment.json)" > environment.json
|