aboutsummaryrefslogtreecommitdiffstats
path: root/appc-directed-graph/dg-loader/provider/src/main/resources/scripts
diff options
context:
space:
mode:
authorPatrick Brady <pb071s@att.com>2018-02-06 16:11:42 -0500
committerPatrick Brady <pb071s@att.com>2018-02-07 19:53:26 +0000
commit8eb9f5d4a673cb1ab18423b7e84ec8bc6c96c5b6 (patch)
tree27b79f4690ed142e87be494b89d6f6589f351b36 /appc-directed-graph/dg-loader/provider/src/main/resources/scripts
parentb9be91a588d08ec506783473a8af9689fb4fa9b6 (diff)
Removing old name references
Removing references to bvc, att Change-Id: I794861fe40b96c922f6e5c011b2fe5d2c4bc515b Signed-off-by: Patrick Brady <pb071s@att.com> Issue-ID: APPC-292
Diffstat (limited to 'appc-directed-graph/dg-loader/provider/src/main/resources/scripts')
-rw-r--r--appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh38
1 files changed, 23 insertions, 15 deletions
diff --git a/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh b/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
index d12654282..b499b081d 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
+++ b/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
@@ -25,30 +25,38 @@
###
-export BVC_DIR=/opt/app/bvc
-export DG_DIR=${BVC_DIR}/dg
+###
+### Convert XML DGs to JSON DGs using dg-loader, then load/activate them in the MySQL DB. ###
+###
+
+export APPC_HOME=${APPC_HOME:-/opt/onap/appc}
+
+# SVCLOGIC_DIR env variable points to /opt/onap/appc/svclogic
+export SVCLOGIC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
-if (( "$#" != 1 ))
+#Path to the dg-loader jar file
+export DG_LOADER=${APPC_HOME}/data/dg-loader-provider-jar-with-dependencies.jar
+
+# Check if the JSON Directory exists under the env. variable defined
+export DG_JSON_DIR=${SVCLOGIC_DIR}/graphs/appc/json/dg-loader-dgs
+echo "Processing DG JSON directory : ${DG_JSON_DIR}"
+if [ ! -d "$DG_JSON_DIR" ]
then
- echo "DG JSON Directory is Missing"
+ echo "DG-Loader JSON Directory is Missing"
exit 1
fi
-export DG_JSON_DIR=$1
-echo "Processing DG JSON directory : ${DG_JSON_DIR}"
cd ${DG_JSON_DIR}
+mkdir -p ${DG_JSON_DIR}/converted-xml
-######################################################################
-rm -rf ${DG_JSON_DIR}/xml
-
-################## To Genetare XML from JSON ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLGenerator ${DG_JSON_DIR} ${DG_JSON_DIR}/xml
+# Generate XML DGs from JSON DGs
+$JAVA_HOME/bin/java -cp ${DG_LOADER} org.onap.sdnc.dg.loader.DGXMLGenerator ${DG_JSON_DIR} ${DG_JSON_DIR}/converted-xml
-################## To Load DG XML ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLLoad ${DG_JSON_DIR}/xml ${BVC_DIR}/properties/dblib.properties
+# Load converted XML DGs to the SVC_LOGIC DB in the MySQL Docker Container
+$JAVA_HOME/bin/java -cp ${DG_LOADER} org.onap.sdnc.dg.loader.DGXMLLoad ${DG_JSON_DIR}/converted-xml ${APPC_HOME}/data/properties/dblib.properties
-################## To Activate ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLActivate ${DG_JSON_DIR}/dg_activate.txt ${BVC_DIR}/properties/dblib.properties
+# Activate converted XML DGs to the SVC_LOGIC DB in the MySQL Docker Container
+$JAVA_HOME/bin/java -cp ${DG_LOADER} org.onap.sdnc.dg.loader.DGXMLActivate ${DG_JSON_DIR}/dg_activate.txt ${APPC_HOME}/data/properties/dblib.properties
exit 0