diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2019-04-25 07:45:29 -0500 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2019-04-25 22:26:45 -0500 |
commit | e32d0fac919c8cc5657496a16c300877bd29621e (patch) | |
tree | 43c9ba1b8aa16dab7c809639d9e56a681ebd928b /controlloop/packages | |
parent | a91076ff372a49d080b78b3608bb0d7d26055741 (diff) |
Match up ControlLoopParams against ToscaPolicy
Change-Id: Ia23a5b90b452bcafe2a8aa660598697ebfb07431
Issue-ID: POLICY-1691
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'controlloop/packages')
-rw-r--r-- | controlloop/packages/apps-controlloop/src/files/apps-controlloop-installer | 38 | ||||
-rw-r--r-- | controlloop/packages/docker-controlloop/src/main/docker/docker-entrypoint.sh | 50 |
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 "$@" ;; |