aboutsummaryrefslogtreecommitdiffstats
path: root/ransim/docker/ransim-docker/do-start.sh
diff options
context:
space:
mode:
authorPriyadharshini <priyadharshini.b96@wipro.com>2020-03-16 05:55:43 +0000
committerPriyadharshini <priyadharshini.b96@wipro.com>2020-03-23 09:11:55 +0530
commitcfb63b2c5c381434a6fdea794ad0c2e89a2be328 (patch)
tree586b997a0634198bf0b0ded5dbbde51ff7311b27 /ransim/docker/ransim-docker/do-start.sh
parent44d8e15bda321936078b99f8222175a8ab016bc6 (diff)
Initial code check-in RANSim Controller and RANSim GUI
Issue-ID: INT-1485 Signed-off-by: Priyadharshini <priyadharshini.b96@wipro.com> Change-Id: I99fe693065072ff5c9b188f2177488a4cd93237d
Diffstat (limited to 'ransim/docker/ransim-docker/do-start.sh')
-rw-r--r--ransim/docker/ransim-docker/do-start.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/ransim/docker/ransim-docker/do-start.sh b/ransim/docker/ransim-docker/do-start.sh
new file mode 100644
index 0000000..ec1f601
--- /dev/null
+++ b/ransim/docker/ransim-docker/do-start.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# Script to configure and start the Policy components that are to run in the designated container,
+# It is intended to be used as the entrypoint in the Dockerfile, so the last statement of the
+# script just goes into a long sleep so that the script does not exit (which would cause the
+# container to be torn down).
+
+container=$1
+
+case $container in
+ransim)
+ comps="base ransim mysql"
+ ;;
+*)
+ echo "Usage: do-start.sh ransim" >&2
+ exit 1
+esac
+
+
+# skip installation if build.info file is present (restarting an existing container)
+if [[ -f /opt/app/policy/etc/build.info ]]; then
+ echo "Found existing installation, will not reinstall"
+ . /opt/app/policy/etc/profile.d/env.sh
+
+else
+ if [[ -d config ]]; then
+ cp config/*.conf .
+ fi
+
+ for comp in $comps; do
+ echo "Installing component: $comp"
+ ./docker-install.sh --install $comp
+ done
+ for comp in $comps; do
+ echo "Configuring component: $comp"
+ ./docker-install.sh --configure $comp
+ done
+
+ . /opt/app/policy/etc/profile.d/env.sh
+
+ # install policy keystore
+ mkdir -p $POLICY_HOME/etc/ssl
+ cp config/policy-keystore $POLICY_HOME/etc/ssl
+
+ if [[ -f config/$container-tweaks.sh ]] ; then
+ # file may not be executable; running it as an
+ # argument to bash avoids needing execute perms.
+ bash config/$container-tweaks.sh
+ fi
+
+ if [[ $container == ransim ]]; then
+ # wait for DB up
+ ./wait-for-port.sh mariadb 3306
+ fi
+
+fi
+
+policy.sh start
+
+
+sleep 1000d