4 # ============LICENSE_START=======================================================
6 # ================================================================================
7 # Copyright (C) 2017-2019 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=========================================================
24 # This script takes care of installing the SDNC & APPC platform components
25 # if not already installed, and starts the APPC Docker Container
28 ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
29 ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
30 SDNC_HOME=${SDNC_HOME:-/opt/onap/ccsdk}
31 APPC_HOME=${APPC_HOME:-/opt/onap/appc}
32 SLEEP_TIME=${SLEEP_TIME:-120}
33 MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0}
36 # Adding the DMAAP_TOPIC_ENV variable into APPC-ASDC-LISTENER properties
38 DMAAP_TOPIC_ENV=${DMAAP_TOPIC_ENV}
40 if [ -z "$DMAAP_TOPIC_ENV" ]
42 echo "DMAAP_TOPIC_ENV shell variable is empty. Adding default value OS-ETE-DFW"
43 DMAAP_TOPIC_ENV="OS-ETE-DFW"
45 echo "DMAAP_TOPIC_ENV shell variable exists and it's $DMAAP_TOPIC_ENV"
49 # Wait for database to init properly
51 echo "Waiting for mysql"
52 until mysql -h dbhost -u root -p${MYSQL_PASSWD} mysql &> /dev/null
57 echo -e "\nmysql ready"
59 if [ ! -f ${SDNC_HOME}/.installed ]
61 echo "Installing SDNC database"
62 ${SDNC_HOME}/bin/installSdncDb.sh
63 echo "Installing APPC database"
64 ${APPC_HOME}/bin/installAppcDb.sh
65 echo "Installing ODL Host Key"
66 ${SDNC_HOME}/bin/installOdlHostKey.sh
68 if [ -x ${SDNC_HOME}/svclogic/bin/install.sh ]
70 echo "Installing directed graphs"
71 ${SDNC_HOME}/svclogic/bin/install.sh
77 if [ -x ${APPC_HOME}/svclogic/bin/install-converted-dgs.sh ]
79 echo "Installing APPC JSON DGs converted to XML using dg-loader"
80 ${APPC_HOME}/svclogic/bin/install-converted-dgs.sh
83 echo "Installed at `date`" > ${SDNC_HOME}/.installed
86 echo "Starting cdt-proxy-service jar, logging to ${APPC_HOME}/cdt-proxy-service/jar.log"
87 java -jar ${APPC_HOME}/cdt-proxy-service/cdt-proxy-service.jar > ${APPC_HOME}/cdt-proxy-service/jar.log &
89 echo "Starting ODL/APPC"
90 exec ${ODL_HOME}/bin/karaf server