Fix decanter issue in controller start script 20/85220/3
authorLuis Gomez <ecelgp@gmail.com>
Fri, 18 Oct 2019 23:14:47 +0000 (16:14 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Fri, 18 Oct 2019 23:18:09 +0000 (16:18 -0700)
See INTTEST-60

Change-Id: I9a5b3f71d162c80950e90eba47fe302e2a504abd
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
jjb/integration/common-functions.sh

index 60aeb0e459a81bb3abbc6d020b2535c3332b1d56..e38b07ae033d3c0548c402b7bea239fdda3318f6 100644 (file)
@@ -832,15 +832,24 @@ EOF
 
 function create_post_startup_script() {
     cat > "${WORKSPACE}"/post-startup-script.sh <<EOF
-if [[ "$USEFEATURESBOOT" != "True" ]]; then
+# wait up to 60s for karaf port 8101 to be opened, polling every 5s
+loop_count=0;
+until [[ \$loop_count -ge 12 ]]; do
+    netstat -na | grep 8101 && break;
+    loop_count=\$[\$loop_count+1];
+    sleep 5;
+done
 
-    # wait up to 60s for karaf port 8101 to be opened, polling every 5s
-    loop_count=0;
-    until [[ \$loop_count -ge 12 ]]; do
-        netstat -na | grep 8101 && break;
-        loop_count=\$[\$loop_count+1];
-        sleep 5;
-    done
+# This workaround is required for Karaf decanter to work proper
+# The bundle:refresh command does not fail if the decanter bundles are not present
+echo "ssh to karaf console to do bundle refresh of decanter jmx collector"
+sshpass -p karaf ssh -o StrictHostKeyChecking=no \
+                     -o UserKnownHostsFile=/dev/null \
+                     -o LogLevel=error \
+                     -p 8101 karaf@localhost \
+                     "bundle:refresh org.apache.karaf.decanter.collector.jmx && bundle:refresh org.apache.karaf.decanter.appender.elasticsearch"
+
+if [[ "$USEFEATURESBOOT" != "True" ]]; then
 
     echo "going to feature:install --no-auto-refresh ${SPACE_SEPARATED_FEATURES} one at a time"
     for feature in ${SPACE_SEPARATED_FEATURES}; do