diff --git a/metaculus_web/settings.py b/metaculus_web/settings.py index 6f22f065fe..d0fac67ff3 100644 --- a/metaculus_web/settings.py +++ b/metaculus_web/settings.py @@ -244,7 +244,6 @@ STATIC_URL = "static/" STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") -STATICFILES_DIRS = [BASE_DIR / "static"] # Default primary key field type # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field diff --git a/scripts/deploy_to_heroku.sh b/scripts/deploy_to_heroku.sh index e8bb1db9ef..38725a1b8c 100755 --- a/scripts/deploy_to_heroku.sh +++ b/scripts/deploy_to_heroku.sh @@ -9,6 +9,25 @@ for var in "${required_vars[@]}"; do fi done +wait_and_fail_if_release_failed() { + max_iters=10 + for ((i = 1; i <= max_iters; i++)); do + json=$(heroku releases --json) + # Extract the status and current fields from the first element of the array + status=$(echo "$json" | jq -r '.[0].status') + current=$(echo "$json" | jq -r '.[0].current') + + [ "$status" == "pending" ] && echo "Waiting for release to finish" && sleep 1 && continue + + [ "$status" == "succeeded" ] && [ "$current" == "true" ] && echo "Release succeeded " && exit 0 + + break + done + + echo "Release failed." + exit 1 +} + # These are needed for nextjs build phase, as it replaces the value of these environmental variables # at build time :/ FRONTEND_ENV_FILE=$(mktemp) @@ -30,3 +49,5 @@ done # Release them all heroku container:release release web dramatiq_worker django_cron -a $HEROKU_APP + +wait_and_fail_if_release_failed \ No newline at end of file