X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fpolicy%2Fcharts%2Fdrools%2Fresources%2Fconfig%2Fopt%2Fpolicy%2Fconfig%2Fdrools%2Fdrools-tweaks.sh;h=5f504e2c65d5ea57819d102054067ebb641792ae;hb=d76196456604da6e6d97e63a4e67c13984bc19f8;hp=62822ac824d40b80c5161aa8f1b9b31dc739ddb1;hpb=3250c8ab036a6558374f893135065ebb7a2290a1;p=oom.git diff --git a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh index 62822ac824..5f504e2c65 100644 --- a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh +++ b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh @@ -1,4 +1,6 @@ -# Copyright © 2017 Amdocs, Bell Canada, AT&T +#! /bin/bash -xv + +# Copyright © 2017-2018 Amdocs, Bell Canada, AT&T # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +14,58 @@ # See the License for the specific language governing permissions and # limitations under the License. -#! /bin/bash -${POLICY_HOME}/bin/features enable healthcheck +"${POLICY_HOME}"/bin/features enable healthcheck +"${POLICY_HOME}"/bin/features enable distributed-locking + +"${POLICY_HOME}"/bin/db-migrator -s pooling -o upgrade + +# make sure the PDPD-CONFIGURATION anonymous topic is created +# so not to lose any configuration updates + +echo +echo "testing publish to PDPD-CONFIGURATION topic" +echo + +curl --silent --connect-timeout 15 -X POST --header "Content-Type: application/json" -d "{}" http://message-router:3904/events/PDPD-CONFIGURATION + +echo +echo "testing subscribe to PDPD-CONFIGURATION topic " +echo + +curl --silent --connect-timeout 15 -X GET http://message-router:3904/events/PDPD-CONFIGURATION/1/1?timeout=5000 + +# for resiliency/scalability scenarios, check to see +# if there's an amsterdam artifact already deployed +# by brmsgw. If so, update the amsterdam controller +# coordinates. In the future, a more sophisticated +# solution will be put in place, that will required +# coordination among policy components. + +echo +echo "checking if there are amsterdam policies already deployed .." +echo + +AMSTERDAM_VERSION=$(curl --silent --connect-timeout 20 -X GET "http://nexus:8081/nexus/service/local/artifact/maven/resolve?r=releases&g=org.onap.policy-engine.drools.amsterdam&a=policy-amsterdam-rules&v=RELEASE" | grep -Po "(?<=).*(?=)") + +if [[ -z ${AMSTERDAM_VERSION} ]]; then + echo "no amsterdam policies have been found .." + exit 0 +fi + +echo +echo "The latest deployed amsterdam artifact in nexus has version ${AMSTERDAM_VERSION}" +echo + +sed -i.INSTALL -e "s/^rules.artifactId=.*/rules.artifactId=policy-amsterdam-rules/g" \ + -e "s/^rules.groupId=.*/rules.groupId=org.onap.policy-engine.drools.amsterdam/g" \ + -e "s/^rules.version=.*/rules.version=${AMSTERDAM_VERSION}/g" "${POLICY_HOME}"/config/amsterdam-controller.properties + +echo +echo "amsterdam controller will be started brained with maven coordinates:" +echo + +grep "^rules" "${POLICY_HOME}"/config/amsterdam-controller.properties + +echo +echo