Optionally load available applications 27/41227/1 v1.2.0
authorJorge Hernandez <jh1730@att.com>
Thu, 5 Apr 2018 17:19:21 +0000 (12:19 -0500)
committerJorge Hernandez <jh1730@att.com>
Thu, 5 Apr 2018 17:19:21 +0000 (12:19 -0500)
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 <jh1730@att.com>
packages/docker/pom.xml
packages/docker/src/main/docker/Dockerfile
packages/docker/src/main/docker/do-start.sh

index 5d90809..8d745d2 100644 (file)
                                                        </artifactItems>
                                                </configuration>
                                        </execution>
-                                        <execution>
-                                                <id>copy-apps-zip</id>
-                                                <phase>prepare-package</phase>
-                                                <goals>
-                                                        <goal>copy</goal>
-                                                </goals>
-                                                <configuration>
-                                                        <outputDirectory>${project.build.directory}/policy-drools</outputDirectory>
-                                                        <overWriteReleases>false</overWriteReleases>
-                                                        <overWriteSnapshots>true</overWriteSnapshots>
-                                                        <artifactItems>
-                                                                <artifactItem>
-                                                                        <groupId>org.onap.policy.drools-applications.controlloop.packages</groupId>
-                                                                        <artifactId>apps-controlloop</artifactId>
-                                                                        <version>${project.version}</version>
-                                                                        <type>zip</type>
-                                                                        <destFileName>apps-controlloop.zip</destFileName>
-                                                                </artifactItem>
-                                                        </artifactItems>
-                                                </configuration>
-                                        </execution>
                                 </executions>
                         </plugin>
                         <plugin>
index 6d5c4ab..b06edf1 100644 (file)
@@ -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
 
index 5f15697..56c07bc 100644 (file)
@@ -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