aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2019-08-27 15:30:23 -0500
committerjhh <jorge.hernandez-herrero@att.com>2019-08-27 15:30:23 -0500
commitc08643d82c6f615da747a8b4dedaac77277d4433 (patch)
treee81d8b739f393812069abb75add22134def7ba35
parente6152a0e4fa208670e74514018a36700d2fe2151 (diff)
Support arbitrary container init scripts
Issue-ID: POLICY-1371 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ic1c15e6f36fe3eead937d4595b994747e830eb7a
-rw-r--r--controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh b/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh
index 73781619e..0c7fab9f8 100644
--- a/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh
+++ b/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh
@@ -63,13 +63,15 @@ function scripts {
set -x
fi
- if ! ls "${POLICY_INSTALL_INIT}"/*.sh 2>&1; then
+ local scriptExtSuffix=${1:-"sh"}
+
+ if ! ls "${POLICY_INSTALL_INIT}"/*."${scriptExtSuffix}" 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
+ for s in $(ls "${POLICY_INSTALL_INIT}"/*."${scriptExtSuffix}" 2> /dev/null); do
echo "executing script: ${s}"
source "${s}"
done
@@ -206,7 +208,7 @@ function reload {
features
security
properties
- scripts
+ scripts "pre.sh"
}
function start {
@@ -238,6 +240,7 @@ function vmBoot {
reload
db
start
+ scripts "post.sh"
}
function dockerBoot {
@@ -268,6 +271,8 @@ case "${operation}" in
;;
configure) configure
;;
+ nexus) nexus
+ ;;
*) exec "$@"
;;
esac