run.sh

Mon, 20 Mar 2023 11:40:59 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 20 Mar 2023 11:40:59 +0000
changeset 5
e28748388509
parent 2
e245cf75db68
permissions
-rwxr-xr-x

Fix field name of implementation status in the JSON

#!/bin/bash

set -xeo pipefail

python3 tools/prepare_xep_list.py
python3 tools/prepare_software_list.py
python3 tools/prepare_compliance.py

lua normalize_json.lua

sqlite-utils insert xmpp.db xeps db_xeps.json --pk=id
sqlite-utils insert xmpp.db software db_software.json --pk=id
sqlite-utils insert xmpp.db software_platforms db_software_platforms.json --pk=software_id --pk=platform
sqlite-utils insert xmpp.db software_categories db_software_categories.json --pk=software_id --pk=category
sqlite-utils insert xmpp.db implementations db_implementations.json --pk=xep_id --pk=software_id
sqlite-utils insert xmpp.db compliance_levels db_compliance.json
sqlite-utils add-foreign-key xmpp.db implementations xep_id xeps id
sqlite-utils add-foreign-key xmpp.db implementations software_id software id
sqlite-utils add-foreign-key xmpp.db compliance_levels xep_id xeps id
sqlite-utils add-foreign-key xmpp.db software_platforms software_id software id
sqlite-utils add-foreign-key xmpp.db software_categories software_id software id

# Precompute row counts for performance
datasette inspect xmpp.db --inspect-file=counts.json

exec datasette serve \
  -h 0.0.0.0 \
  --metadata metadata.yml \
  -i xmpp.db \
  --inspect-file=counts.json \
  --setting base_url "$DATASETTE_PATH"

mercurial