Proposal to remove OSGi dependencies from the CCSDK project
[ccsdk/distribution.git] / lighty / lighty-ubuntu-docker / src / main / scripts / startODL.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # openECOMP : SDN-C
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights
8 #                             reserved.
9 # ================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
13 #
14 #      http://www.apache.org/licenses/LICENSE-2.0
15 #
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END=========================================================
22 ###
23
24
25 # Install SDN-C platform components if not already installed and start container
26
27 ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
28 CCSDK_HOME=${CCSDK_HOME:-/opt/onap/ccsdk}
29 SLEEP_TIME=${SLEEP_TIME:-120}
30 MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0}
31
32
33 #
34 # Wait for database
35 #
36 echo "Waiting for mysql"
37 until mysql -h dbhost -u root -p${MYSQL_PASSWD} mysql &> /dev/null
38 do
39   printf "."
40   sleep 1
41 done
42 echo -e "\nmysql ready"
43
44 echo "Installing SDN-C database"
45 ${CCSDK_HOME}/bin/installSdncDb.sh
46 if [ -x ${CCSDK_HOME}/svclogic/bin/install.sh ]
47 then
48     echo "Installing directed graphs"
49     ${CCSDK_HOME}/svclogic/bin/install.sh
50 fi
51
52 exec java -jar opt/lighty/ccsdk-lighty-distribution-0.5.0-SNAPSHOT/ccsdk-lighty-distribution-0.5.0-SNAPSHOT.jar /opt/onap/ccsdk/data/properties/lightyCcsdkConfig.json