metatroncubeswdev 85f2b4b11a O0: Docker/Odoo 19 CE scaffolding
docker-compose.yml (postgres 16 + odoo:19.0), odoo.conf, env template,
and setup/backup/update/demo-data scripts. update.sh always backs up
and records the previous image before upgrading modules, per the
lesson paid for on the Frappe track. .gitattributes pins LF on shell
scripts so they don't break under the container's bash on checkout
from Windows.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 06:45:58 -04:00

25 lines
870 B
Bash

#!/bin/bash
# Loads the demo school (St. Aloysius Public School) by installing every
# mc_education_* module found under ./addons with demo data enabled.
# See ../shared/DEMO_SCRIPT.md for what this data must support.
#
# Usage: ./scripts/demo-data.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$SCRIPT_DIR"
set -a; [ -f .env ] && source .env; set +a
DB_NAME="${ODOO_DB_NAME:-school}"
MODULES=$(ls addons | grep '^mc_education_' | paste -sd, -)
if [ -z "$MODULES" ]; then
echo "[!] No mc_education_* modules found under ./addons yet."
exit 1
fi
echo "[->] Creating/loading database '${DB_NAME}' with demo data for: ${MODULES}"
docker compose exec odoo odoo -c /etc/odoo/odoo.conf -d "$DB_NAME" -i "$MODULES" --without-demo=False --stop-after-init
echo "[OK] Demo school loaded. Log in at the credentials in shared/DEMO_SCRIPT.md."