From 3ad277569c8966442d8b56c4ca6ccc4efd40acd7 Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Mon, 30 Apr 2018 17:24:44 -0500 Subject: Make custom preinstallation available in image This script could be used by OOM installation to trigger the installation of a drools application or other purposes (ie. control loop) Change-Id: Iafdb413ee85aa341351481584e8c967cc1a3c112 Issue-ID: POLICY-566 Signed-off-by: Jorge Hernandez --- packages/docker/src/main/docker/Dockerfile | 2 ++ packages/docker/src/main/docker/do-start.sh | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'packages') diff --git a/packages/docker/src/main/docker/Dockerfile b/packages/docker/src/main/docker/Dockerfile index b06edf1b..f04b0cf5 100644 --- a/packages/docker/src/main/docker/Dockerfile +++ b/packages/docker/src/main/docker/Dockerfile @@ -2,12 +2,14 @@ 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} ENV POLICY_LOGS ${POLICY_LOGS} diff --git a/packages/docker/src/main/docker/do-start.sh b/packages/docker/src/main/docker/do-start.sh index dfb65e52..fa4cd6ab 100644 --- a/packages/docker/src/main/docker/do-start.sh +++ b/packages/docker/src/main/docker/do-start.sh @@ -32,9 +32,10 @@ else cp config/*.conf . fi - # wait for nexus up before installing, since installation - # needs to deploy some artifacts to the repo - ./wait-for-port.sh nexus 8081 + 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 @@ -43,12 +44,11 @@ else fi apps=$(ls config/apps*.zip 2> /dev/null) - - echo "Applications found: ${apps}" - - if [[ -n ${apps} ]]; then - unzip -o ${apps} - fi + for app in $apps + do + echo "Application found: ${app}" + unzip -o ${app} + done echo "docker install at ${PWD}" @@ -61,7 +61,7 @@ else cp config/policy-keystore ${POLICY_HOME}/etc/ssl fi - if [[ -x config/drools-tweaks.sh ]] ; then + 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. -- cgit 1.2.3-korg