From ff681ef0a970535e5da5f90478fa59100bb6208d Mon Sep 17 00:00:00 2001
From: sblimkie <steven.blimkie@amdocs.com>
Date: Fri, 23 Feb 2018 12:33:06 -0500
Subject: Make container parameters configurable

Params such as number of threads, Queue sizes, Heap size
are now configurable when deploying Gizmo

Change-Id: Ib58ff9cdf9e96378db7feaf3e7168267d05fd1e9
Issue-ID: AAI-807
Signed-off-by: sblimkie <steven.blimkie@amdocs.com>
---
 src/main/bin/start.sh | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

(limited to 'src')

diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh
index 843e4c5..1447175 100644
--- a/src/main/bin/start.sh
+++ b/src/main/bin/start.sh
@@ -1,28 +1,31 @@
-#!/bin/sh
+#!/bin/bash
 
 BASEDIR="/opt/app/crud-api/"
 AJSC_HOME="$BASEDIR"
 AJSC_CONF_HOME="$AJSC_HOME/bundleconfig/"
 
+# List of ajsc properties which are exposed for modification at deploy time
+declare -a MODIFY_PROP_LIST=("KEY_STORE_PASSWORD"
+                             "KEY_MANAGER_PASSWORD"
+                             "AJSC_JETTY_ThreadCount_MIN" 
+                             "AJSC_JETTY_ThreadCount_MAX"
+                             "AJSC_JETTY_BLOCKING_QUEUE_SIZE")
+PROP_LIST_LENGTH=${#MODIFY_PROP_LIST[@]}  
+
+for (( i=1; i<${PROP_LIST_LENGTH}+1; i++ ));
+do
+   PROP_NAME=${MODIFY_PROP_LIST[$i-1]}
+   PROP_VALUE=${!PROP_NAME}
+   if [ ! -z "$PROP_VALUE" ]; then
+      sed -i "s/$PROP_NAME.*$/$PROP_NAME=$PROP_VALUE/g" $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
+   fi
+done
+
 if [ -z "$CONFIG_HOME" ]; then
 	echo "CONFIG_HOME must be set in order to start up process"
 	exit 1
 fi
 
-if [ -z "$KEY_STORE_PASSWORD" ]; then
-	echo "KEY_STORE_PASSWORD must be set in order to start up process"
-	exit 1
-else
-	echo "KEY_STORE_PASSWORD=$KEY_STORE_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
-fi
-
-if [ -z "$KEY_MANAGER_PASSWORD" ]; then
-	echo "KEY_MANAGER_PASSWORD must be set in order to start up process"
-	exit 1
-else
-	echo "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
-fi
-
 # Add any spring bean configuration files to the Gizmo deployment
 if [ -n "$SERVICE_BEANS" ]; then
         echo "Adding the following dynamic service beans to the deployment: "
-- 
cgit