summaryrefslogtreecommitdiffstats
path: root/kubernetes/appc
diff options
context:
space:
mode:
authorAaron Hay <aaron.hay@att.com>2018-11-19 17:52:59 -0500
committerAaron Hay <aaron.hay@att.com>2018-11-19 23:14:10 +0000
commitafb0a0916b35b641e42477985a7aa1b2bb6937c3 (patch)
tree87b03d6e34fbc5771c3b83c017cf54cb8739f487 /kubernetes/appc
parent90b21b1a7649f60ad3470fa4affaacc6f64ea174 (diff)
Store .installed marker in persistent volume
Change-Id: Id53eb39a9b7a5865b40e3248421340cba37762d2 Issue-ID: APPC-1243 Signed-off-by: Aaron Hay <aaron.hay@att.com>
Diffstat (limited to 'kubernetes/appc')
-rwxr-xr-xkubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh54
-rw-r--r--kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties2
-rw-r--r--kubernetes/appc/values.yaml3
3 files changed, 35 insertions, 24 deletions
diff --git a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
index 705f3effb5..6a36fdf37b 100755
--- a/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
+++ b/kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
@@ -56,28 +56,11 @@ 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
#
echo "Waiting for mariadbgalera"
@@ -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
diff --git a/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties b/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties
index d0a237acc8..770142ad59 100644
--- a/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties
+++ b/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties
@@ -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}}
diff --git a/kubernetes/appc/values.yaml b/kubernetes/appc/values.yaml
index 2c3f300e66..9c5a50110a 100644
--- a/kubernetes/appc/values.yaml
+++ b/kubernetes/appc/values.yaml
@@ -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