diff options
author | 2019-02-28 10:10:49 -0600 | |
---|---|---|
committer | 2019-03-01 09:56:11 -0600 | |
commit | b001c1ac5a0b4d938a69adb47f4613f64dc71c1a (patch) | |
tree | a83c2887edc25fd4eb24f3f6d485e8f860069c19 /packages/docker/src/main | |
parent | 8e9ddde1bb1e3fc3f7b85af653d6251daf7e77d6 (diff) |
move all hard install config to environment vars
+ support multiple system properties files with variable interpolation
loaded at initialization
+ support of configurable JVM options (-X, etc ..).
+ rearrange aaf configuration to avoid {{}} installation variables
and use dynamic enviroment variables.
+ miscellaneous clean up in areas touched and checkstyle.
Change-Id: I71ad839778e17eb57c098a2c5cc2bf96e468669a
Issue-ID: POLICY-1524
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'packages/docker/src/main')
-rw-r--r-- | packages/docker/src/main/docker/Dockerfile | 4 | ||||
-rw-r--r-- | packages/docker/src/main/docker/do-start.sh | 147 |
2 files changed, 67 insertions, 84 deletions
diff --git a/packages/docker/src/main/docker/Dockerfile b/packages/docker/src/main/docker/Dockerfile index 087dcb47..829bb6b0 100644 --- a/packages/docker/src/main/docker/Dockerfile +++ b/packages/docker/src/main/docker/Dockerfile @@ -1,14 +1,10 @@ FROM ubuntu:14.04 -ARG HTTP_PROXY=${HTTP_PROXY} -ARG HTTPS_PROXY=${HTTPS_PROXY} ARG BUILD_VERSION=${BUILD_VERSION} ARG POLICY_HOME=/opt/app/policy ARG POLICY_LOGS=/var/log/onap/policy/pdpd ARG POLICY_INSTALL=/tmp/policy-install -ENV http_proxy $HTTP_PROXY -ENV https_proxy $HTTPS_PROXY ENV BUILD_VERSION ${BUILD_VERSION} ENV POLICY_INSTALL ${POLICY_INSTALL} ENV POLICY_HOME ${POLICY_HOME} diff --git a/packages/docker/src/main/docker/do-start.sh b/packages/docker/src/main/docker/do-start.sh index 91402e62..4687e421 100644 --- a/packages/docker/src/main/docker/do-start.sh +++ b/packages/docker/src/main/docker/do-start.sh @@ -1,9 +1,9 @@ #!/bin/bash ### # ============LICENSE_START======================================================= -# +# ONAP # ================================================================================ -# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. +# 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. @@ -19,84 +19,71 @@ # ============LICENSE_END========================================================= ### -# skip installation if build.info file is present (restarting an existing container) -if [[ -f ${POLICY_HOME}/etc/build.info ]]; then - echo "Found existing installation, will not reinstall" - . ${POLICY_HOME}/etc/profile.d/env.sh -else - echo "installing .." - - # replace conf files from installer with environment-specific files - # mounted from the hosting VM - if [[ -d config ]]; then - cp config/*.conf . - fi - - if [[ -f config/drools-preinstall.sh ]] ; then - echo "found preinstallation script" - bash config/drools-preinstall.sh - fi - - # remove broken symbolic links if any in data directory - if [[ -d ${POLICY_HOME}/config ]]; then - echo "removing dangling symbolic links" - find -L ${POLICY_HOME}/config -type l -exec rm -- {} + - fi - - apps=$(ls config/apps*.zip 2> /dev/null) - for app in $apps - do - echo "Application found: ${app}" - unzip -o ${app} - done - - feats=$(ls config/feature*.zip 2> /dev/null) - for feat in $feats - do - echo "Feature found: ${feat}" - cp ${feat} . - done - - echo "docker install at ${PWD}" - - ./docker-install.sh - - . ${POLICY_HOME}/etc/profile.d/env.sh - - # allow user to override the key or/and the trust stores - - if [[ -f config/policy-keystore ]]; then - cp -f config/policy-keystore ${POLICY_HOME}/etc/ssl - fi - - if [[ -f config/policy-truststore ]]; then - cp -f config/policy-truststore ${POLICY_HOME}/etc/ssl - fi - - # allow user to override all or some aaf configuration - - if [[ -f config/aaf.properties ]]; then - cp -f config/aaf.properties ${POLICY_HOME}/config/aaf.properties - fi - - if [[ -f config/aaf-location.properties ]]; then - cp -f config/aaf-location.properties ${POLICY_HOME}/config/aaf-location.properties - fi - - if [[ -f config/aaf-credentials.properties ]]; then - cp -f config/aaf-credentials.properties ${POLICY_HOME}/config/aaf-credentials.properties - fi - - if [[ -f config/aaf-cadi.keyfile ]]; then - cp -f config/aaf-cadi.keyfile ${POLICY_HOME}/config/aaf-cadi.keyfile - fi - - if [[ -f config/drools-tweaks.sh ]] ; then - echo "Executing tweaks" - # file may not be executable; running it as an - # argument to bash avoids needing execute perms. - bash config/drools-tweaks.sh - fi +echo "installing .." + +# replace conf files from installer with environment-specific files +# mounted from the hosting VM + +if [[ -d config ]]; then + cp config/*.conf . +fi + +if [[ -f config/drools-preinstall.sh ]] ; then + echo "found preinstallation script" + bash config/drools-preinstall.sh +fi + +# remove broken symbolic links if any in data directory +if [[ -d ${POLICY_HOME}/config ]]; then + echo "removing dangling symbolic links" + find -L ${POLICY_HOME}/config -type l -exec rm -- {} + +fi + +apps=$(ls config/apps*.zip 2> /dev/null) +for app in $apps +do + echo "Application found: ${app}" + unzip -o ${app} +done + +feats=$(ls config/feature*.zip 2> /dev/null) +for feat in $feats +do + echo "Feature found: ${feat}" + cp ${feat} . +done + +echo "docker install at ${PWD}" + +./docker-install.sh + +source ${POLICY_HOME}/etc/profile.d/env.sh + +# allow user to override the key or/and the trust stores + +if [[ -f config/policy-keystore ]]; then + cp -f config/policy-keystore ${POLICY_HOME}/etc/ssl +fi + +if [[ -f config/policy-truststore ]]; then + cp -f config/policy-truststore ${POLICY_HOME}/etc/ssl +fi + +# allow user to override all or some aaf configuration + +if [[ -f config/aaf.properties ]]; then + cp -f config/aaf.properties ${POLICY_HOME}/config/aaf.properties +fi + +if [[ -f config/aaf-cadi.keyfile ]]; then + cp -f config/aaf-cadi.keyfile ${POLICY_HOME}/config/aaf-cadi.keyfile +fi + +if [[ -f config/drools-tweaks.sh ]] ; then + echo "Executing tweaks" + # file may not be executable; running it as an + # argument to bash avoids needing execute perms. + bash config/drools-tweaks.sh fi echo "Starting processes" |