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

Add Makefile for initializing Wagtail DB for review apps, update instructions #1193

Merged
merged 1 commit into from
Jan 7, 2025
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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ councilmatic_core_person.csv :
SELECT name, slug \
FROM councilmatic_core_person \
) TO STDOUT WITH CSV HEADER\"" > $@

include wagtail.mk
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ This repo is set up to deploy review apps on Heroku, and those pull from the sta
1. Configure the S3 connection, as documented above.
2. Once a release phase successfully completes, provision an Essential 0 database for your review app.
3. Retrieve the URI from the Credentials tab.
4. Run `export HEROKU_DATABASE_URL=<YOUR URI HERE>`.
5. If needed, run `docker compose run --rm -e DATABASE_URL=${HEROKU_DATABASE_URI} scrapers` to populate initial legislative data.
6. Run `docker compose run --rm -e DATABASE_URL=${HEROKU_DATABASE_URI} app python manage.py load_content` to populate initial CMS content from the version controlled fixtures.
4. Update the app's `DATABASE_URL` config value to the new URI.
5. On your local machine, run `DATABASE_URL=<YOUR URI HERE> make -e wagtail_db`. This will populate initial legislative data and import content from the version controlled fixture data.

## Adding a new board member

Expand Down
14 changes: 14 additions & 0 deletions wagtail.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DATABASE_URL=

wagtail_db : legislative_data cms_data

cms_data : db
docker compose run --rm -e DATABASE_URL=${DATABASE_URL} app python manage.py load_content

legislative_data : db
docker compose run --rm -e DATABASE_URL=${DATABASE_URL} scrapers

db :
if [ -z "${DATABASE_URL}" ]; then \
echo "Please set a value for DATABASE_URL env var" && exit 1; \
fi