Skip to content

Commit

Permalink
Merge pull request #1095 from Metro-Records/feature/review-apps
Browse files Browse the repository at this point in the history
Enable review apps with the staging database
  • Loading branch information
xmedr authored Apr 18, 2024
2 parents 8e273be + 92a4661 commit a196460
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
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

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

0 comments on commit a196460

Please sign in to comment.