From 5e12619208f2c9f041c2db354445107879cb5be2 Mon Sep 17 00:00:00 2001 From: Vijay N Date: Mon, 13 Jul 2026 00:38:23 +0530 Subject: [PATCH] Enhance launch script for multi-tier deployment. --- .../how-to-set-up-a-multi-tier-system.adoc | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/userguide/aws/how-to-set-up-a-multi-tier-system.adoc b/userguide/aws/how-to-set-up-a-multi-tier-system.adoc index 52fb01e48..faf6d609f 100644 --- a/userguide/aws/how-to-set-up-a-multi-tier-system.adoc +++ b/userguide/aws/how-to-set-up-a-multi-tier-system.adoc @@ -158,6 +158,7 @@ To configure the EC2 instances and establish their connection to the databases, [source,bash] ---- #!/bin/bash +set -euo pipefail db_host="" db_port="" @@ -165,6 +166,8 @@ db_user="" db_password="" kb_admin_password="" +KB_PLUGINS_TEMP_DIR="/var/lib/killbill/bundles/temp" + cat << EOF >> /etc/environment KB_org_killbill_dao_url=jdbc:mysql://$db_host:$db_port/killbill KB_org_killbill_dao_user=$db_user @@ -182,6 +185,42 @@ KAUI_DB_USERNAME=$db_user KAUI_DB_PASSWORD=$db_password KAUI_KILLBILL_URL=http://127.0.0.1:8080 EOF + +echo "Waiting for plugin SQL files..." + +for i in {1..60}; do + if ls ${KB_PLUGINS_TEMP_DIR}/*/*.sql >/dev/null 2>&1; then + break + fi + + sleep 10 +done + +echo "Installing plugin DDLs..." + +find "${KB_PLUGINS_TEMP_DIR}" \ + -mindepth 2 \ + -maxdepth 2 \ + -name "*.sql" \ + | sort \ + | while read -r ddl_file; do + + plugin_name=$(basename "$(dirname "$ddl_file")") + + echo "Installing DDL for plugin: ${plugin_name}" + echo "Executing file: ${ddl_file}" + + mysql \ + --host="${db_host}" \ + --port="${db_port}" \ + --user="${db_user}" \ + --password="${db_password}" \ + killbill < "${ddl_file}" + + echo "Completed plugin: ${plugin_name}" +done + +echo "All plugin DDLs installed successfully" ---- In the above script, replace the value of `db_host` with the full name of the DB writer endpoint obtained from the Connectivity and Security panel, as indicated earlier. Be sure to specify the appropriate database port number (`3306` for MySQL or `5432` for PostgreSQL) by setting `db_port`. The `kb_admin_password` value will be utilized as the admin password for Kaui login.