sc-dev-deploy/scripts/installDevDeployTenant.sh
2026-06-01 16:43:43 -05:00

18 lines
933 B
Bash
Executable file

#!/usr/bin/env bash
# Clean per-tenant installer for dev-deploy on the Postgres MULTI-TENANT
# instance (.dev-state-pg). Replaces the manual "INSERT INTO <t>._sc_plugins"
# SQL hack: registers + enables the plugin in each tenant schema and runs its
# onLoad (creating the _dd_* tables + bootstrapping the env). After this, per-tenant
# onLoad re-runs automatically on every boot via init_multi_tenant->loadAllPlugins.
#
# Prerequisites: the tenants must already exist (saltcorn create-tenant <name>),
# and the plugin must be installed into the PG public schema once (the normal
# install-plugin -d ./dev-deploy path) so the shared plugins_folder copy exists.
#
# Usage: ./dev-deploy/scripts/installDevDeployTenant.sh t1 t2 (or '*' for all tenants)
set -e
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
cd "$ROOT"
# shellcheck disable=SC1091
source .dev-state-pg/env.sh
node "$ROOT/dev-deploy/scripts/installDevDeployTenant.js" "$@"