summaryrefslogtreecommitdiffstats
path: root/src/main/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scripts')
-rw-r--r--src/main/scripts/encNameValue.sh20
-rw-r--r--src/main/scripts/start.sh61
2 files changed, 78 insertions, 3 deletions
diff --git a/src/main/scripts/encNameValue.sh b/src/main/scripts/encNameValue.sh
new file mode 100644
index 0000000..daefd00
--- /dev/null
+++ b/src/main/scripts/encNameValue.sh
@@ -0,0 +1,20 @@
+# The script invokes the com.amdocs.aai.audit.security.encryption.EncryptedPropValue class to generate an encrypted value
+# e.g
+# ./encNameValue.sh odl.auth.password admin
+# will return:
+# odl.auth.password.x=f1e2c25183ef4b4ff655e7cd94d0c472
+#
+if [ "$#" -ne 2 ]; then
+ echo "Illegal number of parameters (expected 2)"
+ echo "Usage: `basename $0` <property name> <property value>" 1>&2
+ exit 1
+fi
+
+# On Windows we must use a different CLASSPATH separator character
+if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
+ CPSEP=\;
+else
+ CPSEP=:
+fi
+
+java -cp ".${CPSEP}../extJars/*" com.att.aai.util.EncryptedPropValue -n $1 -v $2
diff --git a/src/main/scripts/start.sh b/src/main/scripts/start.sh
index 3d1af06..fc063ad 100644
--- a/src/main/scripts/start.sh
+++ b/src/main/scripts/start.sh
@@ -2,6 +2,7 @@
BASEDIR="/opt/app/sparky"
AJSC_HOME="$BASEDIR"
+AJSC_CONF_HOME="$BASEDIR/bundleconfig/"
if [ -z "$CONFIG_HOME" ]; then
echo "CONFIG_HOME must be set in order to start up process"
@@ -12,14 +13,64 @@ if [ -z "$KEY_STORE_PASSWORD" ]; then
echo "KEY_STORE_PASSWORD must be set in order to start up process"
exit 1
else
- echo -e "KEY_STORE_PASSWORD=$KEY_STORE_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
+ 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 -e "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
+ echo "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
+fi
+
+if [ -z "$UI_HTTPS_PORT" ] && [ -z "$UI_HTTP_PORT" ]; then
+ echo "Either UI_HTTPS_PORT or UI_HTTP_PORT must be set in order to start up process"
+ exit 1
+fi
+
+# Add any routes configured at deploy time to the sparky deployment
+if [ -n "$DYNAMIC_ROUTES" ]; then
+ if [ -e /opt/app/sparky/services/inventory-ui-service_v1.zip ]; then
+ echo "Adding the following dynamic routes to the deployment: "
+ mkdir -p /tmp/sparky/v1/routes
+ for f in `ls $DYNAMIC_ROUTES`
+ do
+ cp $DYNAMIC_ROUTES/$f /tmp/sparky/v1/routes
+ echo "Adding dynamic route $DYNAMIC_ROUTES/$f"
+ done
+ jar uf /opt/app/sparky/services/inventory-ui-service_v1.zip* -C /tmp/ sparky
+ rm -rf /tmp/sparky
+ fi
+fi
+
+# Add any spring bean configuration files to the sparky deployment
+if [ -n "$SERVICE_BEANS" ]; then
+ if [ -e /opt/app/sparky/services/inventory-ui-service_v1.zip ]; then
+ echo "Adding the following dynamic service beans to the deployment: "
+ mkdir -p /tmp/sparky/v1/conf
+ for f in `ls $SERVICE_BEANS`
+ do
+ cp $SERVICE_BEANS/$f /tmp/sparky/v1/conf
+ echo "Adding dynamic service bean $SERVICE_BEANS/$f"
+ done
+ jar uf /opt/app/sparky/services/inventory-ui-service_v1.zip* -C /tmp/ sparky
+ rm -rf /tmp/sparky
+ fi
+fi
+
+# Add any dynamic component configuration files to the sparky deployment
+if [ -n "$COMPLIB" ]; then
+ if [ -e /opt/app/sparky/services/inventory-ui-service_v1.zip ]; then
+ echo "Adding the following dynamic libraries to the deployment: "
+ mkdir -p /tmp/sparky/v1/lib
+ for f in `ls $COMPLIB`
+ do
+ cp $COMPLIB/$f /tmp/sparky/v1/lib
+ echo "Adding dynamic library $COMPLIB/$f"
+ done
+ jar uf /opt/app/sparky/services/inventory-ui-service_v1.zip* -C /tmp/ sparky
+ rm -rf /tmp/sparky
+ fi
fi
CLASSPATH="$AJSC_HOME/lib/ajsc-runner-2.0.0.jar"
@@ -39,4 +90,8 @@ PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME"
echo $CLASSPATH
-/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms1024m -Xmx4096m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=/ port=9517
+if [ "$UI_HTTPS_PORT" ]; then
+ /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms1024m -Xmx4096m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=/ sslport=$UI_HTTPS_PORT
+elif [ "$UI_HTTP_PORT" ]; then
+ /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms1024m -Xmx4096m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=/ port=$UI_HTTP_PORT
+fi \ No newline at end of file