summaryrefslogtreecommitdiffstats
path: root/packages/docker/src
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2018-04-30 17:24:44 -0500
committerJorge Hernandez <jh1730@att.com>2018-04-30 20:29:33 -0500
commit3ad277569c8966442d8b56c4ca6ccc4efd40acd7 (patch)
tree3a8ed54e8c88443bbdaa401ab1392c8bb11d07aa /packages/docker/src
parent43d1d7f7769f88236364c982e13d76cc6cbc26db (diff)
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 <jh1730@att.com>
Diffstat (limited to 'packages/docker/src')
-rw-r--r--packages/docker/src/main/docker/Dockerfile2
-rw-r--r--packages/docker/src/main/docker/do-start.sh20
2 files changed, 12 insertions, 10 deletions
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.