From cfb63b2c5c381434a6fdea794ad0c2e89a2be328 Mon Sep 17 00:00:00 2001 From: Priyadharshini Date: Mon, 16 Mar 2020 05:55:43 +0000 Subject: Initial code check-in RANSim Controller and RANSim GUI Issue-ID: INT-1485 Signed-off-by: Priyadharshini Change-Id: I99fe693065072ff5c9b188f2177488a4cd93237d --- ransim/docker/ransim-docker/do-start.sh | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 ransim/docker/ransim-docker/do-start.sh (limited to 'ransim/docker/ransim-docker/do-start.sh') 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 -- cgit 1.2.3-korg