Move property file modify script
[appc/deployment.git] / installation / appc / src / main / scripts / dockerInstall.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # APPC
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
12
13 #      http://www.apache.org/licenses/LICENSE-2.0
14
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=========================================================
21 ###
22
23 #
24 # This script runs during docker image build.
25 # It starts opendaylight, installs the appc features, then shuts down opendaylight.
26 #
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}
33
34 appcInstallStartTime=$(date +%s)
35
36
37 echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
38 sleep ${SLEEP_TIME}
39
40 echo "Checking that Karaf can be accessed"
41 clientOutput=$(${ODL_HOME}/bin/client shell:echo KarafLoginCheckIsWorking)
42 if echo "$clientOutput" | grep -q "KarafLoginCheckIsWorking"; then
43 echo "Karaf login succeeded"
44 else
45 echo "Error during Karaf login"
46 exit 1
47 fi
48
49 echo "Installing APPC platform features"
50 ${APPC_HOME}/bin/installFeatures.sh
51
52 appcInstallEndTime=$(date +%s)
53 echo "Total Appc install took $(expr $appcInstallEndTime - $appcInstallStartTime) seconds"