4 # ============LICENSE_START=======================================================
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
13 # http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
23 COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
24 . ${COMMON_ENV_PATH}/common_functions.sh
33 if [ ! -d "$INPUT_PATH" ]; then
34 echo "Input directory $INPUT_PATH does not exist!!";
38 if [ $(ls ${INPUT_PATH}/* 2> /dev/null | wc -l) -eq 0 ]; then
39 echo "Input directory $INPUT_PATH does not contain any migration files!!";
43 INPUT_DIR_FOR_JAVA=${INPUT_PATH}/combined
44 mkdir -p "$INPUT_DIR_FOR_JAVA"
45 INPUT_FILE_FOR_JAVA=${INPUT_DIR_FOR_JAVA}/sorted_dmaap_files.txt
46 sort -g -k 1 -t '_' $(find ${INPUT_PATH}/* -maxdepth 0 -type f) | awk -F '_' '{ print $2"_"$3; }' > $INPUT_FILE_FOR_JAVA
50 ARGS="-c ${PROJECT_HOME}/resources/etc/appprops/janusgraph-realtime.properties --inputFile $INPUT_FILE_FOR_JAVA"
52 if [ -f "$PROJECT_HOME/resources/application.properties" ]; then
53 # Get the application properties file and look for all lines
54 # starting with either jms dmaap or niws
55 # Turn them into system properties and export JAVA_PRE_OPTS so
56 # execute spring jar will get those values
57 # This is only needed since dmaap is used by run_migrations
58 JAVA_PRE_OPTS=$(egrep '^jms.bind.address' $PROJECT_HOME/resources/application.properties | cut -d"=" -f2- | sed 's/^\(.*\)$/-Dactivemq.tcp.url=\1/g' | tr '\n' ' ');
62 execute_spring_jar org.onap.aai.util.SendMigrationNotificationsMain ${PROJECT_HOME}/resources/migration-logback.xml ${ARGS} "$@"