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