From a73501afc572e3f2142253855cc66f8ad084e593 Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Thu, 5 Apr 2018 12:19:21 -0500 Subject: Optionally load available applications During container instantiation, it will check for available applications to preload, ie. control loop or any other ones. It will install them if available or start with no applications loaded otherwise. Change-Id: I6908d279cbe34e04bcabf830ed30480ba147598f Issue-ID: POLICY-735 Signed-off-by: Jorge Hernandez --- packages/docker/pom.xml | 21 --------------------- packages/docker/src/main/docker/Dockerfile | 5 ++--- packages/docker/src/main/docker/do-start.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 5d90809b..8d745d28 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -65,27 +65,6 @@ - - copy-apps-zip - prepare-package - - copy - - - ${project.build.directory}/policy-drools - false - true - - - org.onap.policy.drools-applications.controlloop.packages - apps-controlloop - ${project.version} - zip - apps-controlloop.zip - - - - diff --git a/packages/docker/src/main/docker/Dockerfile b/packages/docker/src/main/docker/Dockerfile index 6d5c4ab7..b06edf1b 100644 --- a/packages/docker/src/main/docker/Dockerfile +++ b/packages/docker/src/main/docker/Dockerfile @@ -42,13 +42,12 @@ RUN mkdir -p ${POLICY_HOME}/config ${POLICY_LOGS} ${POLICY_INSTALL}/config && \ WORKDIR ${POLICY_INSTALL} -COPY install-drools.zip apps-controlloop.zip docker-install.sh do-start.sh wait-for-port.sh ./ +COPY install-drools.zip docker-install.sh do-start.sh wait-for-port.sh ./ VOLUME [ "${POLICY_INSTALL}/config", "${POLICY_HOME}/config" ] RUN unzip -o install-drools.zip && \ - unzip -o apps-controlloop.zip && \ - rm install-drools.zip apps-controlloop.zip && \ + rm install-drools.zip && \ chown -R policy:policy * && \ chmod +x *.sh diff --git a/packages/docker/src/main/docker/do-start.sh b/packages/docker/src/main/docker/do-start.sh index 5f156979..56c07bc1 100644 --- a/packages/docker/src/main/docker/do-start.sh +++ b/packages/docker/src/main/docker/do-start.sh @@ -23,6 +23,14 @@ else find -L ${POLICY_HOME}/config -type l -exec rm -- {} + fi + apps=$(ls config/apps*.zip 2> /dev/null) + + echo "Applications found: ${apps}" + + if [[ -n ${apps} ]]; then + unzip -o ${apps} + fi + echo "docker install at ${PWD}" ./docker-install.sh -- cgit 1.2.3-korg