4 # ============LICENSE_START=======================================================
6 # ================================================================================
7 # Copyright (C) 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 runs during docker image build.
25 # It starts opendaylight, installs the appc features, then shuts down opendaylight.
27 ODL_HOME=${ODL_HOME:-/opt/opendaylight}
28 ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
29 SDNC_HOME=${SDNC_HOME:-/opt/onap/ccsdk}
30 APPC_HOME=${APPC_HOME:-/opt/onap/appc}
31 SLEEP_TIME=${SLEEP_TIME:-120}
32 MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0}
34 appcInstallStartTime=$(date +%s)
37 echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
40 echo "Checking that Karaf can be accessed"
41 ##clientOutput=$(${ODL_HOME}/bin/client shell:echo KarafLoginCheckIsWorking)
42 clientOutput=$(sshpass -pkaraf ssh -o StrictHostKeyChecking=no karaf@localhost -p 8101 "shell:echo KarafLoginCheckIsWorking")
43 if echo "$clientOutput" | grep -q "KarafLoginCheckIsWorking"; then
44 echo "Karaf login succeeded"
46 echo "Error during Karaf login"
50 echo "Installing APPC platform features"
51 ${APPC_HOME}/bin/installFeatures.sh
53 appcInstallEndTime=$(date +%s)
54 echo "Total Appc install took $(expr $appcInstallEndTime - $appcInstallStartTime) seconds"