aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/packages
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/packages')
-rw-r--r--controlloop/packages/apps-controlloop/src/files/apps-controlloop-installer38
-rw-r--r--controlloop/packages/docker-controlloop/src/main/docker/docker-entrypoint.sh50
2 files changed, 46 insertions, 42 deletions
diff --git a/controlloop/packages/apps-controlloop/src/files/apps-controlloop-installer b/controlloop/packages/apps-controlloop/src/files/apps-controlloop-installer
deleted file mode 100644
index 95fef711e..000000000
--- a/controlloop/packages/apps-controlloop/src/files/apps-controlloop-installer
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-###
-# ============LICENSE_START=======================================================
-# Apps Installation Package
-# ================================================================================
-# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-#
-# This file will be automatically invoked by the main pdp-d installer
-# for drools applications
-#
-
-echo
-echo "**********************************"
-echo " CONTROL LOOP APP INSTALL "
-echo "**********************************"
-echo
-
-features enable controlloop-trans
-features enable controlloop-management
-features enable controlloop-amsterdam
-
-
diff --git a/controlloop/packages/docker-controlloop/src/main/docker/docker-entrypoint.sh b/controlloop/packages/docker-controlloop/src/main/docker/docker-entrypoint.sh
index 8afc2c0db..73781619e 100644
--- a/controlloop/packages/docker-controlloop/src/main/docker/docker-entrypoint.sh
+++ b/controlloop/packages/docker-controlloop/src/main/docker/docker-entrypoint.sh
@@ -25,6 +25,10 @@ function configurations {
local confName
+ if ! ls "${POLICY_INSTALL_INIT}"/*.conf 2>&1; then
+ return 0
+ fi
+
for c in $(ls "${POLICY_INSTALL_INIT}"/*.conf 2> /dev/null); do
echo "adding configuration file: ${c}"
cp -f "${c}" "${POLICY_HOME}"/etc/profile.d/
@@ -41,6 +45,10 @@ function features {
set -x
fi
+ if ! ls "${POLICY_INSTALL_INIT}"/features*.zip 2>&1; then
+ return 0
+ fi
+
source "${POLICY_HOME}"/etc/profile.d/env.sh
for f in $(ls "${POLICY_INSTALL_INIT}"/features*.zip 2> /dev/null); do
@@ -55,6 +63,10 @@ function scripts {
set -x
fi
+ if ! ls "${POLICY_INSTALL_INIT}"/*.sh 2>&1; then
+ return 0
+ fi
+
source "${POLICY_HOME}"/etc/profile.d/env.sh
for s in $(ls "${POLICY_INSTALL_INIT}"/*.sh 2> /dev/null); do
@@ -97,6 +109,10 @@ function properties {
set -x
fi
+ if ! ls "${POLICY_INSTALL_INIT}"/*.properties 2>&1; then
+ return 0
+ fi
+
for p in $(ls "${POLICY_INSTALL_INIT}"/*.properties 2> /dev/null); do
echo "configuration properties: ${p}"
cp -f "${p}" "${POLICY_HOME}"/config
@@ -113,6 +129,9 @@ function db {
return 0
fi
+ echo "Wating for ${SQL_HOST} ."
+ timeout 120 bash -c 'until nc -vz "${SQL_HOST}" 3306; do echo -n "."; sleep 1; done'; echo $?
+
"${POLICY_HOME}"/bin/db-migrator -s ALL -o upgrade
}
@@ -200,7 +219,17 @@ function start {
policy start
}
-function boot {
+function configure {
+ if [[ ${DEBUG} == y ]]; then
+ echo "-- ${FUNCNAME[0]} --"
+ set -x
+ fi
+
+ reload
+ db
+}
+
+function vmBoot {
if [[ ${DEBUG} == y ]]; then
echo "-- ${FUNCNAME[0]} --"
set -x
@@ -209,12 +238,21 @@ function boot {
reload
db
start
+}
+
+function dockerBoot {
+ if [[ ${DEBUG} == y ]]; then
+ echo "-- ${FUNCNAME[0]} --"
+ set -x
+ fi
+
+ set -e
+
+ vmBoot
tail -f /dev/null
}
-set -e
-
if [[ ${DEBUG} == y ]]; then
echo "-- $0 $* --"
set -x
@@ -224,7 +262,11 @@ operation="${1}"
case "${operation}" in
inspect) inspect
;;
- boot) boot
+ boot) dockerBoot
+ ;;
+ vmboot) vmBoot
+ ;;
+ configure) configure
;;
*) exec "$@"
;;