diff --git a/README.md b/README.md index 5193601..422c852 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,9 @@ Start elasticsearch on your machine and run the following commands npm install cd plugins git clone git@github.com:stagemonitor/stagemonitor-kibana.git + cd stagemonitor-kibana npm install - cd .. + cd ../.. npm start Access Kibana under https://localhost:5601 -> the lazy optimizations may take some minutes for the initial pageload. diff --git a/build-all.sh b/build-all.sh new file mode 100755 index 0000000..609c7a0 --- /dev/null +++ b/build-all.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +if [ -z "$1" ]; then + echo "Usage: ./build-all.sh PLUGIN_VERSION" + exit +fi; + + +for KIBANA_VERSION in 5.4.0 5.4.1 5.4.2 5.4.3 5.5.0 5.5.1 +do + ./build.sh ${KIBANA_VERSION} $1 +done diff --git a/build.sh b/build.sh index debcfad..3bd5e08 100755 --- a/build.sh +++ b/build.sh @@ -2,17 +2,38 @@ echo "building archive ..." +if [ -z "$1" ]; then + echo "Usage: ./build.sh KIBANA_VERSION PLUGIN_VERSION" + exit +else + VERSION_KIBANA="$1" +fi; + +if [ -z "$2" ]; then + echo "Usage: ./build.sh KIBANA_VERSION PLUGIN_VERSION" + exit +else + VERSION_PLUGIN="$2" +fi; + +FILENAME=/tmp/stagemonitor-kibana-${VERSION_PLUGIN}_-_${VERSION_KIBANA}.zip + + +echo "building archive for $VERSION_KIBANA ..." + BASEDIR=$(dirname "$0") -rm -rf /tmp/kibana -rm /tmp/stagemonitor-kibana.zip +rm -rf /tmp/kibana > /dev/null || true +rm $FILENAME > /dev/null || true mkdir /tmp/kibana cp -r "$BASEDIR" /tmp/kibana/stagemonitor-kibana +sed "s/@@VERSION@@/$VERSION_KIBANA/g" /tmp/kibana/stagemonitor-kibana/package.json.template > /tmp/kibana/stagemonitor-kibana/package.json +rm -rf /tmp/kibana/stagemonitor-kibana/.git cd /tmp -zip -r stagemonitor-kibana.zip kibana +zip -r $FILENAME kibana > /dev/null echo "" -echo "The built archive is here: /tmp/stagemonitor-kibana.zip" +echo "The built archive is here: $FILENAME" echo "Install it in kibana with:" -echo "\$KIBANA_DIR/bin/kibana-plugin install /tmp/stagemonitor-kibana.zip" +echo "\$KIBANA_DIR/bin/kibana-plugin install file://$FILENAME" diff --git a/package.json b/package.json index bad2b5d..4218078 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "name": "stagemonitor-kibana", - "version": "5.5.0", + "version": "5.4.0", "dependencies": { - "dagre-d3-webpack": "0.4.17" + "dagre-d3-webpack": "0.4.17", + "flat": "^4.0.0" } } diff --git a/package.json.template b/package.json.template new file mode 100644 index 0000000..a1b81b5 --- /dev/null +++ b/package.json.template @@ -0,0 +1,8 @@ +{ + "name": "stagemonitor-kibana", + "version": "@@VERSION@@", + "dependencies": { + "dagre-d3-webpack": "0.4.17", + "flat": "^4.0.0" + } +} diff --git a/public/app.js b/public/app.js index 549e30d..c200baa 100644 --- a/public/app.js +++ b/public/app.js @@ -1,4 +1,5 @@ import 'ui/autoload/all'; +import modules from 'ui/modules'; import { uiModules } from 'ui/modules'; import uiRoutes from 'ui/routes'; @@ -21,7 +22,18 @@ uiRoutes controllerAs: 'ctrl' }); -uiModules +let realUiModule; +if (modules) { + // kibana 5.4.x + realUiModule = modules; + console.log('5.4.x'); +} else { + // kibana 5.5.x + realUiModule = uiModules; + console.log('5.5.x'); +} + +realUiModule .get('app/stagemonitor', ['elasticsearch', 'kibana']) .service('elasticsearchService', ElasticsearchService) .controller('traceListController', traceListController)