-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace check-instance-ready endpoint to use status instead of stats from CanarieAPI #293
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,29 +13,31 @@ COMPOSE_DIR="`dirname "$THIS_DIR"`" | |
|
||
if [ -f "$COMPOSE_DIR/env.local" ]; then | ||
# Get PAVICS_FQDN | ||
. $COMPOSE_DIR/env.local | ||
. "${COMPOSE_DIR}/env.local" | ||
fi | ||
|
||
MONITOR_URL="https://${PAVICS_FQDN}/canarie/node/service/status" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing we could do is use Technically, |
||
set -x | ||
curl --include --silent https://$PAVICS_FQDN/canarie/node/service/stats | head | ||
curl --include --silent "${MONITOR_URL}" | head | ||
|
||
set +x | ||
echo " | ||
The curl above should return the HTTP response code 200 to confirm instance is ready. | ||
" | ||
set -x | ||
|
||
HTTP_RESPONSE_CODE="`curl --write-out '%{http_code}' --output /dev/null --silent https://$PAVICS_FQDN/canarie/node/service/stats`" | ||
if [ $HTTP_RESPONSE_CODE -ne 200 ]; then | ||
HTTP_RESPONSE_CODE=$(curl --write-out '%{http_code}' --output /dev/null --silent "${MONITOR_URL}") | ||
if [ "${HTTP_RESPONSE_CODE}" -ne 200 ]; then | ||
set +x | ||
echo " | ||
HTTP response code received: $HTTP_RESPONSE_CODE (expected 200). | ||
HTTP response code received: ${HTTP_RESPONSE_CODE} (expected 200). | ||
|
||
Will sleep for about 1 minute and try again since the canarie-api refresh every minute. | ||
|
||
Will retry only once more and exit immediately. | ||
" | ||
set -x | ||
sleep 65 | ||
curl --include --silent https://$PAVICS_FQDN/canarie/node/service/stats | head | ||
curl --include --silent "${MONITOR_URL}" | head | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watch out, this change will conflict with the DELAYED_EVAL PR.