#!/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 ._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 ), # 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" "$@"