Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion metaculus_web/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions scripts/deploy_to_heroku.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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