Move appc install to runtime
Since ccsdk dblib does not work after a restart of
karaf, the appc install scripts must be modified so
that karaf is not started during docker build.
Change-Id: Ibdca395fe9335d9a778927ec69324c0d7545cace
Signed-off-by: Patrick Brady <patrick.brady@att.com>
Issue-ID: APPC-1683
diff --git a/installation/appc/src/main/docker/Dockerfile b/installation/appc/src/main/docker/Dockerfile
index 2d38fe3..8ea9e1a 100644
--- a/installation/appc/src/main/docker/Dockerfile
+++ b/installation/appc/src/main/docker/Dockerfile
@@ -49,7 +49,7 @@
RUN mkdir /opt/onap/appc/cvaas
#Start opendaylight and pre-install the appc features
-RUN opt/onap/appc/bin/dockerInstall.sh
+#RUN opt/onap/appc/bin/dockerInstall.sh
# Expose port 8181 for ODL REST calls
EXPOSE 8181
diff --git a/installation/appc/src/main/scripts/dockerInstall.sh b/installation/appc/src/main/scripts/dockerInstall.sh
index acd0def..7708dcb 100644
--- a/installation/appc/src/main/scripts/dockerInstall.sh
+++ b/installation/appc/src/main/scripts/dockerInstall.sh
@@ -33,11 +33,7 @@
appcInstallStartTime=$(date +%s)
-ODL_BOOT_FEATURES_EXTRA="odl-netconf-connector,odl-restconf-noauth,odl-netconf-clustered-topology,odl-mdsal-clustering"
-sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,${ODL_BOOT_FEATURES_EXTRA}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
-echo "Starting OpenDaylight"
-${ODL_HOME}/bin/start
echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
sleep ${SLEEP_TIME}
@@ -76,13 +72,13 @@
cp ${APPC_HOME}/data/keystore ${ODL_HOME}/etc/keystore
cp ${APPC_HOME}/data/custom.properties ${ODL_HOME}/etc/custom.properties
-echo "Stopping OpenDaylight and waiting for it to stop"
-${ODL_HOME}/bin/stop
+#echo "Stopping OpenDaylight and waiting for it to stop"
+#${ODL_HOME}/bin/stop
#The karaf command will exit when odl shuts down. This is the most reliable way to wait for opendaylight to stop
#before exiting the docker container.
-${ODL_HOME}/bin/client
-echo "Karaf process has stopped"
-sleep 10s
+#${ODL_HOME}/bin/client
+#echo "Karaf process has stopped"
+#sleep 10s
appcInstallEndTime=$(date +%s)
echo "Total Appc install took $(expr $appcInstallEndTime - $appcInstallStartTime) seconds"
diff --git a/installation/appc/src/main/scripts/startODL.sh b/installation/appc/src/main/scripts/startODL.sh
index 52e524b..fdb2c58 100644
--- a/installation/appc/src/main/scripts/startODL.sh
+++ b/installation/appc/src/main/scripts/startODL.sh
@@ -87,4 +87,9 @@
java -jar ${APPC_HOME}/cdt-proxy-service/cdt-proxy-service.jar > ${APPC_HOME}/cdt-proxy-service/jar.log &
echo "Starting ODL/APPC"
+ODL_BOOT_FEATURES_EXTRA="odl-netconf-connector,odl-restconf-noauth,odl-netconf-clustered-topology,odl-mdsal-clustering"
+sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,${ODL_BOOT_FEATURES_EXTRA}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
+
+exec ${APPC_HOME}/bin/dockerInstall.sh &
+echo "Starting OpenDaylight"
exec ${ODL_HOME}/bin/karaf server