X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=installation%2Fappc%2Fsrc%2Fmain%2Fscripts%2FdockerInstall.sh;h=8ae86ca30cb2cfd225a7e05d5c79dea5dfdde9bd;hb=39cf2fc84846a59e02b51313b01153a276e2c08c;hp=7708dcb7f151673498a07754f926c104deb798a0;hpb=6989e98ea8d2293aa90aacc1b864fb724643156e;p=appc%2Fdeployment.git diff --git a/installation/appc/src/main/scripts/dockerInstall.sh b/installation/appc/src/main/scripts/dockerInstall.sh index 7708dcb..8ae86ca 100644 --- a/installation/appc/src/main/scripts/dockerInstall.sh +++ b/installation/appc/src/main/scripts/dockerInstall.sh @@ -9,9 +9,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,60 +25,38 @@ # It starts opendaylight, installs the appc features, then shuts down opendaylight. # ODL_HOME=${ODL_HOME:-/opt/opendaylight} -ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} SDNC_HOME=${SDNC_HOME:-/opt/onap/ccsdk} APPC_HOME=${APPC_HOME:-/opt/onap/appc} -SLEEP_TIME=${SLEEP_TIME:-120} -MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0} appcInstallStartTime=$(date +%s) - -echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize" -sleep ${SLEEP_TIME} - +TIME_OUT=1000 +INTERVAL=30 +TIME=0 echo "Checking that Karaf can be accessed" -clientOutput=$(${ODL_HOME}/bin/client shell:echo KarafLoginCheckIsWorking) -if echo "$clientOutput" | grep -q "KarafLoginCheckIsWorking"; then -echo "Karaf login succeeded" -else -echo "Error during Karaf login" -exit 1 +while [ "$TIME" -lt "$TIME_OUT" ]; do + +##clientOutput=$(${ODL_HOME}/bin/client shell:echo KarafLoginCheckIsWorking) + clientOutput=$(sshpass -pkaraf ssh -o StrictHostKeyChecking=no karaf@localhost -p 8101 "shell:echo KarafLoginCheckIsWorking") + if echo "$clientOutput" | grep -q "KarafLoginCheckIsWorking"; then + echo "Karaf login succeeded" + echo localhost ready in $TIME seconds + break; + else + echo Sleep: $INTERVAL seconds before localhost address is ready. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + fi + + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) +done + +if [ "$TIME" -ge "$TIME_OUT" ]; then + echo "Error during Karaf login, abort manual run dockerInstall.sh to instaill APPC platform features" + exit 1 fi -echo "Copying a working version of the logging configuration into the opendaylight etc folder" -cp ${APPC_HOME}/data/org.ops4j.pax.logging.cfg ${ODL_HOME}/etc/org.ops4j.pax.logging.cfg -#echo "Copying a new version of aaf cadi shiro into the opendaylight deploy folder" -#cp ${APPC_HOME}/data/aaf-shiro-aafrealm-osgi-bundle.jar ${ODL_HOME}/deploy/aaf-shiro-aafrealm-osgi-bundle.jar - -echo "Installing APPC platform features" +echo "Karaf login is ready, installing APPC platform features" ${APPC_HOME}/bin/installFeatures.sh -echo "Adding a property system.properties for AAF cadi.properties location" -echo "" >> ${ODL_HOME}/etc/system.properties -echo "cadi_prop_files=${APPC_HOME}/data/properties/cadi.properties" >> ${ODL_HOME}/etc/system.properties -echo "" >> ${ODL_HOME}/etc/system.properties - -echo "Adding a value to property appc.asdc.env in appc.properties for appc-asdc-listener feature" -echo "" >> $APPC_HOME/data/properties/appc.properties -echo "appc.asdc.env=$DMAAP_TOPIC_ENV" >> $APPC_HOME/data/properties/appc.properties -echo "" >> $APPC_HOME/data/properties/appc.properties - -echo "Copying the aaa shiro configuration into opendaylight" -cp ${APPC_HOME}/data/aaa-app-config.xml ${ODL_HOME}/etc/opendaylight/datastore/initial/config/aaa-app-config.xml - -echo "Copying jetty, keystore for https into opendalight" -cp ${APPC_HOME}/data/jetty.xml ${ODL_HOME}/etc/jetty.xml -cp ${APPC_HOME}/data/keystore ${ODL_HOME}/etc/keystore -cp ${APPC_HOME}/data/custom.properties ${ODL_HOME}/etc/custom.properties - -#echo "Stopping OpenDaylight and waiting for it to stop" -#${ODL_HOME}/bin/stop -#The karaf command will exit when odl shuts down. This is the most reliable way to wait for opendaylight to stop -#before exiting the docker container. -#${ODL_HOME}/bin/client -#echo "Karaf process has stopped" -#sleep 10s - appcInstallEndTime=$(date +%s) echo "Total Appc install took $(expr $appcInstallEndTime - $appcInstallStartTime) seconds"