4 # ============LICENSE_START=======================================================
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights
9 # Modifications Copyright © 2018 Amdocs,Bell Canada
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
15 # http://www.apache.org/licenses/LICENSE-2.0
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 # ============LICENSE_END=========================================================
26 # Install SDN-C platform components if not already installed and start container
28 ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
29 ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
30 SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc}
31 SLEEP_TIME=${SLEEP_TIME:-120}
32 MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}}
37 echo "Waiting for mysql"
38 until mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p{{.Values.config.dbRootPassword}} mysql &> /dev/null
43 echo -e "\nmysql ready"
45 if [ ! -f ${SDNC_HOME}/.installed ]
47 echo "Installing SDN-C database"
48 ${SDNC_HOME}/bin/installSdncDb.sh
49 echo "Starting OpenDaylight"
51 echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
53 echo "Installing SDN-C platform features"
54 ${SDNC_HOME}/bin/installFeatures.sh
55 if [ -x ${SDNC_HOME}/svclogic/bin/install.sh ]
57 echo "Installing directed graphs"
58 ${SDNC_HOME}/svclogic/bin/install.sh
62 echo "Restarting OpenDaylight"
64 echo "Installed at `date`" > ${SDNC_HOME}/.installed
67 exec ${ODL_HOME}/bin/karaf