Store .installed marker in persistent volume 00/73100/2
authorAaron Hay <aaron.hay@att.com>
Mon, 19 Nov 2018 22:52:59 +0000 (17:52 -0500)
committerAaron Hay <aaron.hay@att.com>
Mon, 19 Nov 2018 23:14:10 +0000 (23:14 +0000)
Change-Id: Id53eb39a9b7a5865b40e3248421340cba37762d2
Issue-ID: APPC-1243
Signed-off-by: Aaron Hay <aaron.hay@att.com>
kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties
kubernetes/appc/values.yaml

index 705f3ef..6a36fdf 100755 (executable)
@@ -56,27 +56,10 @@ SLEEP_TIME=${SLEEP_TIME:-120}
 MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.mariadbRootPassword}}}
 ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false}
 ENABLE_AAF=${ENABLE_AAF:-true}
+DBINIT_DIR=${DBINIT_DIR:-/opt/opendaylight/current/daexim}
 
 appcInstallStartTime=$(date +%s)
 
-#
-# Adding the DMAAP_TOPIC_ENV variable into APPC-ASDC-LISTENER properties
-#
-DMAAP_TOPIC_ENV=${DMAAP_TOPIC_ENV}
-
-if [ -z "$DMAAP_TOPIC_ENV" ]
-        then
-        echo "DMAAP_TOPIC_ENV shell variable is empty. Adding default value OS-ETE-DFW"
-                DMAAP_TOPIC_ENV="OS-ETE-DFW"
-        else
-                echo "DMAAP_TOPIC_ENV shell variable exists and it's $DMAAP_TOPIC_ENV"
-fi
-
-echo "Adding a value to property appc.asdc.env in appc.properties for appc-asdc-listener feature"
-echo "" >> $APPC_HOME/data/properties/appc.properties
-echo "appc.asdc.env=$DMAAP_TOPIC_ENV" >> $APPC_HOME/data/properties/appc.properties
-echo "" >> $APPC_HOME/data/properties/appc.properties
-
 #
 # Wait for database to init properly
 #
@@ -88,14 +71,39 @@ do
 done
 echo -e "\nmariadbgalera ready"
 
-if [ ! -f ${SDNC_HOME}/.installed ]
+if [ ! -d ${DBINIT_DIR} ]
 then
-        echo "Installing SDNC database"
-        ${SDNC_HOME}/bin/installSdncDb.sh
+    mkdir -p ${DBINIT_DIR}
+fi
 
-        echo "Installing APPC database"
-        ${APPC_HOME}/bin/installAppcDb.sh
+if [ ! -f ${DBINIT_DIR}/.installed ]
+then
+        sdnc_db_exists=$(mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p{{.Values.config.mariadbRootPassword}} mysql <<-END
+show databases like 'sdnctl';
+END
+)
+        if [ "x${sdnc_db_exists}" == "x" ]
+        then
+            echo "Installing SDNC database"
+            ${SDNC_HOME}/bin/installSdncDb.sh
+        fi
+
+        appc_db_exists=$(mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p{{.Values.config.mariadbRootPassword}} mysql <<-END
+show databases like 'appcctl';
+END
+)
+        if [ "x${appc_db_exists}" == "x" ]
+        then
+            echo "Installing APPC database"
+            ${APPC_HOME}/bin/installAppcDb.sh
+        fi
 
+        echo "Installed at `date`" > ${DBINIT_DIR}/.installed
+fi
+
+
+if [ ! -f ${SDNC_HOME}/.installed ]
+then
         echo "Installing ODL Host Key"
         ${SDNC_HOME}/bin/installOdlHostKey.sh
 
index d0a237a..770142a 100644 (file)
@@ -128,3 +128,5 @@ appc.OAM.topic.write=testOAM
 appc.OAM.client.name=testOAM
 appc.OAM.provider.user={{.Values.config.odlUser}}
 appc.OAM.provider.pass={{.Values.config.odlPassword}}
+
+appc.asdc.env={{.Values.config.dmaapTopicEnv}}
index 2c3f300..9c5a501 100644 (file)
@@ -31,7 +31,7 @@ global:
 flavor: small
 # application image
 repository: nexus3.onap.org:10001
-image: onap/appc-image:1.4.0
+image: onap/appc-image:1.4.2-SNAPSHOT-latest
 pullPolicy: Always
 
 # flag to enable debugging - application support required
@@ -51,6 +51,7 @@ config:
   enableClustering: false
   configDir: /opt/onap/appc/data/properties
   dmaapTopic: SUCCESS
+  dmaapTopicEnv: AUTO
   logstashServiceName: log-ls
   logstashPort: 5044
   odlPassword: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U