summaryrefslogtreecommitdiffstats
path: root/controlloop/packages/docker-controlloop/src/main
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2019-04-25 07:45:29 -0500
committerjhh <jorge.hernandez-herrero@att.com>2019-04-25 22:26:45 -0500
commite32d0fac919c8cc5657496a16c300877bd29621e (patch)
tree43c9ba1b8aa16dab7c809639d9e56a681ebd928b /controlloop/packages/docker-controlloop/src/main
parenta91076ff372a49d080b78b3608bb0d7d26055741 (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/docker-controlloop/src/main')
-rw-r--r--controlloop/packages/docker-controlloop/src/main/docker/docker-entrypoint.sh50
1 files changed, 46 insertions, 4 deletions
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 "$@"
;;