Platform Hardening for DG - Part 8
[appc.git] / appc-directed-graph / dg-loader / provider / src / main / resources / scripts / dg_load_activate.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # ONAP : APPC
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
8 # ================================================================================
9 # Copyright (C) 2017 Amdocs
10 # =============================================================================
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
14
15 #      http://www.apache.org/licenses/LICENSE-2.0
16
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22
23 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 # ============LICENSE_END=========================================================
25 ###
26
27
28 export BVC_DIR=/opt/app/bvc
29 export DG_DIR=${BVC_DIR}/dg
30
31 if (( "$#" != 1 )) 
32 then
33     echo "DG JSON Directory is Missing"
34 exit 1
35 fi
36
37 export DG_JSON_DIR=$1
38 echo "Processing DG JSON directory : ${DG_JSON_DIR}"
39
40 cd ${DG_JSON_DIR}
41
42 ######################################################################
43 rm -rf ${DG_JSON_DIR}/xml
44
45 ################## To Genetare XML from JSON ########################
46 $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
47
48 ################## To Load DG XML ########################
49 $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
50
51 ################## To Activate ########################
52 $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
53
54 exit 0