Merge "DG changes for the closed loop and async support in MDONS"
[sdnc/oam.git] / data-migrator / src / main / scripts / runMigration.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # openECOMP : SDN-C
6 # ================================================================================
7 # Copyright (C) 2019 AMDOCS
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 PROPERTY_DIR=${PROPERTY_DIR:-/opt/onap/sdnc/data/properties}
24 MIGRATION=data-migrator
25 MIGRATION_ROOT=${MIGRATION_ROOT:-/opt/onap/sdnc/data-migrator}
26 JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-8-oracle}
27 JAVA_OPTS=${JAVA_OPTS:--Dhttps.protocols=TLSv1.1,TLSv1.2}
28 JAVA=${JAVA:-${JAVA_HOME}/bin/java}
29
30 # Redirect output from script to MIGRATION.out
31 exec >> ${MIGRATION_ROOT}/logs/$MIGRATION.out
32 exec 2>&1
33
34 if [ ! -d ${MIGRATION_ROOT}/logs ]
35 then
36   mkdir ${MIGRATION_ROOT}/logs
37 fi
38
39 for file in ${MIGRATION_ROOT}/lib/*.jar
40 do
41   CLASSPATH=$CLASSPATH:$file
42 done
43
44 ${JAVA} ${JAVA_OPTS} -Dlog4j.configuration=file:${MIGRATION_ROOT}/properties/log4j.properties -cp ${CLASSPATH} org.onap.sdnc.oam.datamigrator.DataMigration $@
45
46 echo $! 
47
48 exit 0