Skip to content
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

Enable review apps with the staging database #1095

Merged
merged 3 commits into from
Apr 18, 2024
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ docker-compose -f docker-compose.yml -f docker-compose.locust.yml run --service-
This will start the Locust web server on http://localhost:8089. For more details,
see the [Locust documentation](https://docs.locust.io/en/stable/).
## Review Apps
This repo is set up to deploy review apps on Heroku, and those pull from the staging database to match the experience of deploying as closely as possible! However, note that in order to prevent unapproved model changes from effecting the staging database, migrations are prevented from running on review apps. So those will still have to be reviewed locally.
## Errors / Bugs
If something is not behaving intuitively, it is a bug, and should be reported.
Expand Down
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"formation": {
"web": {
"quantity": 1,
"size": "hobby"
"size": "basic"
}
},
"environments": {
"review": {
"addons": ["heroku-postgresql:hobby-basic"]
"addons": ["heroku-postgresql:mini"]
}
},
"buildpacks": [],
Expand Down
15 changes: 11 additions & 4 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
set -euo pipefail

python manage.py migrate --noinput
python manage.py createcachetable
python manage.py import_shapes data/final/boundary.geojson
if [ -n "${PRODUCTION}" ] || [ -n "${STAGING}" ]; then
set -euo pipefail

python manage.py migrate --noinput
python manage.py createcachetable
python manage.py import_shapes data/final/boundary.geojson
python manage.py clear_cache

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line seems new. i wonder why the cache wasn't getting cleared before. seems fine to include now


else
echo "PRODUCTION or STAGING is not set, skipping setup management commands"
fi
Loading