diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-07-18 01:26:12 -0500 |
---|---|---|
committer | Jorge Hernandez <jh1730@att.com> | 2017-07-18 01:26:12 -0500 |
commit | 735ece570c6b652c0549439bc92417c67d778550 (patch) | |
tree | 8a7a2134d021c20497dbaa2b54766a6df6d46904 | |
parent | 3de4f73faf3e2aaa3f8f56cebb6ffb3958c3c930 (diff) |
[POLICY-66] self-contained features support
feature unpackaging in feature directory structure
Change-Id: Ifc2ef8a061ff2348d5ad7ddc98a183b7d31159e8
Signed-off-by: Jorge Hernandez <jh1730@att.com>
-rw-r--r-- | policy-drools/docker-install.sh | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/policy-drools/docker-install.sh b/policy-drools/docker-install.sh index a19fbdc9..8bc85c86 100644 --- a/policy-drools/docker-install.sh +++ b/policy-drools/docker-install.sh @@ -331,7 +331,6 @@ function configure_base() { echo "${PROFILE_LINE}" >> "${HOME}/.profile" fi - . "${POLICY_HOME}/etc/profile.d/env.sh" cat "${POLICY_HOME}"/etc/cron.d/* | crontab @@ -459,6 +458,8 @@ function install_base() { configure_base + cp "${BASE_CONF}" "${POLICY_HOME}"/etc/profile.d + # if ! create_keystore; then # echo "error: aborting base installation: creating keystore" # exit 1 @@ -797,6 +798,31 @@ function installArtifacts fi } +function installFeatures +{ + if [[ $DEBUG == y ]]; then + echo "-- ${FUNCNAME[0]} $@ --" + set -x + fi + + FEATURES_HOME="${POLICY_HOME}/features" + mkdir -p "${FEATURES_HOME}" > /dev/null 2>&1 + if [[ -d "${FEATURES_HOME}" && -x "${FEATURES_HOME}" ]]; then + SOURCE_DIR=$PWD + for feature in feature-*.zip ; do + name="${feature#feature-}" + name="${name%-[0-9]*\.zip}" + mkdir -p "${FEATURES_HOME}/${name}" > /dev/null 2>&1 + (cd "${FEATURES_HOME}/${name}"; jar xf ${SOURCE_DIR}/${feature}) + done + + configure_component "${BASE_CONF}" "${FEATURES_HOME}" + else + echo "error: aborting ${FEATURES_HOME} is not accessible" + exit 1 + fi +} + function do_install() { if [[ $DEBUG == y ]]; then @@ -815,21 +841,15 @@ function do_install() COMPONENT_TYPE=policy-management install_controller - # install features - SOURCE_DIR=$PWD - cd $POLICY_HOME - jar xf ${SOURCE_DIR}/feature-healthcheck-*.zip - cd ${SOURCE_DIR} - + installFeatures installArtifacts - + echo echo "Installation complete" echo "Please logoff and login again to update shell environment" } -DEBUG=n export POLICY_USER=$(/usr/bin/id -un) export POLICY_GROUP=$POLICY_USER |