From c00f87082254998866860c557b508fec87a329be Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Wed, 17 Apr 2024 15:02:40 -0400 Subject: [PATCH 1/3] don't run management commands for review apps --- scripts/release.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index 91f9df39a..0caaebe0b 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -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 + +else + echo "PRODUCTION or STAGING is not set, skipping setup management commands" +fi From 02565e066e54e0d57a0bef4a3e110f33e6b74cf0 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Wed, 17 Apr 2024 15:23:45 -0400 Subject: [PATCH 2/3] update heroku dynos --- app.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.json b/app.json index 1318d9182..8ad634e74 100644 --- a/app.json +++ b/app.json @@ -4,12 +4,12 @@ "formation": { "web": { "quantity": 1, - "size": "hobby" + "size": "basic" } }, "environments": { "review": { - "addons": ["heroku-postgresql:hobby-basic"] + "addons": ["heroku-postgresql:mini"] } }, "buildpacks": [], From 92a4661543b97933033ad28c421fc82ae78b6238 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Wed, 17 Apr 2024 16:20:45 -0400 Subject: [PATCH 3/3] update readme with notes on review apps --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b658e8dc9..3ef63847e 100644 --- a/README.md +++ b/README.md @@ -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.