diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2019-03-04 16:11:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-04 16:11:12 +0000 |
commit | c10a9c1fea3a7c05eb4b4aaf2264855222f1945b (patch) | |
tree | 509d91a93094d68fc5f394dd539de5026a15bfe7 /packages/docker | |
parent | 5ac447f758d9b7a7baaf0e24a0e8621a15b8c5ff (diff) | |
parent | b001c1ac5a0b4d938a69adb47f4613f64dc71c1a (diff) |
Merge "move all hard install config to environment vars"
Diffstat (limited to 'packages/docker')
-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" |