]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
monitoring/grafana/build/Makefile: pull dashboards from local dir
authorDan Mick <dmick@redhat.com>
Wed, 28 Apr 2021 03:31:51 +0000 (20:31 -0700)
committerDan Mick <dmick@redhat.com>
Wed, 26 May 2021 20:37:25 +0000 (13:37 -0700)
Use the dashboard definition files in this workspace directly

Signed-off-by: Dan Mick <dmick@redhat.com>
monitoring/grafana/build/Makefile

index 71e25a36b6f8d01d7dad39c08d1a6c0af08f55f9..8c6be7dadd7b9ac99d0627fde64440acac0a2c92 100755 (executable)
@@ -2,7 +2,7 @@
 GRAFANA_VERSION := 6.7.4-1
 PIECHART_VERSION := "1.4.0"
 STATUS_PANEL_VERSION := "1.0.9"
-DASHBOARD_DIR := "monitoring/grafana/dashboards"
+DASHBOARD_DIR := "../dashboards"
 DASHBOARD_PROVISIONING := "ceph-dashboard.yml"
 IMAGE := "docker.io/centos:8"
 VERSION := "${IMAGE: -1}"
@@ -18,7 +18,7 @@ endif
 
 # Build a grafana instance - preconfigured for use within Ceph's dashboard UI
 
-build : fetch_dashboards
+build :
        echo "Creating base container"
        $(eval CONTAINER := $(shell buildah from ${IMAGE}))
        # Using upstream grafana build
@@ -30,7 +30,7 @@ build : fetch_dashboards
        buildah run $(CONTAINER) grafana-cli plugins install grafana-piechart-panel ${PIECHART_VERSION}
        buildah run $(CONTAINER) grafana-cli plugins install vonage-status-panel ${STATUS_PANEL_VERSION}
        buildah run $(CONTAINER) mkdir -p /etc/grafana/dashboards/ceph-dashboard
-       buildah copy $(CONTAINER) jsonfiles/*.json /etc/grafana/dashboards/ceph-dashboard
+       buildah copy $(CONTAINER) ${DASHBOARD_DIR}/*.json /etc/grafana/dashboards/ceph-dashboard
 
        @/bin/echo -e "\
 apiVersion: 1 \\n\
@@ -70,21 +70,7 @@ providers: \\n\
        buildah commit --format docker --squash $(CONTAINER) ceph-grafana:${ceph_version}
        buildah tag ceph-grafana:${ceph_version} ceph/ceph-grafana:${ceph_version}
 
-
-fetch_dashboards: clean
-       wget -O - https://api.github.com/repos/ceph/ceph/contents/${DASHBOARD_DIR}?ref=${ceph_version} | jq '.[].download_url' > dashboards
-
-       # drop quotes from the list and pick out only json files
-       sed -i 's/\"//g' dashboards
-       sed -i '/\.json/!d' dashboards
-       mkdir jsonfiles 
-       while read -r line; do \
-               wget "$$line" -P jsonfiles; \
-       done < dashboards
-
 clean :
-       rm -f dashboards
-       rm -fr jsonfiles
        rm -f grafana-*.rpm*
        rm -f ${DASHBOARD_PROVISIONING}