From 5ca53846c25517a1a78dafa4f39994fabff6f7c2 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Wed, 20 Apr 2022 11:12:01 +0200 Subject: [PATCH] ci: cleanup makefile, share build.sh with storage --- charts/kubezero-metrics/jsonnet/Makefile | 5 +++-- charts/kubezero-metrics/jsonnet/build.sh | 6 ------ charts/kubezero-metrics/jsonnet/jsonnetfile.lock.json | 10 +++++----- charts/kubezero-metrics/update.sh | 3 +-- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/charts/kubezero-metrics/jsonnet/Makefile b/charts/kubezero-metrics/jsonnet/Makefile index 3561ce47..1cdfc6e4 100644 --- a/charts/kubezero-metrics/jsonnet/Makefile +++ b/charts/kubezero-metrics/jsonnet/Makefile @@ -16,9 +16,10 @@ fmt: find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ xargs -n 1 -- $(JSONNET_FMT) -i -generate: build.sh +generate: clean build.sh bash build.sh $< - + jsonnet -J vendor -m dashboards -e '(import "dashboards.libsonnet").grafanaDashboards' + jsonnet -J vendor -m rules rules.libsonnet lint: find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ while read f; do \ diff --git a/charts/kubezero-metrics/jsonnet/build.sh b/charts/kubezero-metrics/jsonnet/build.sh index c272c3c4..c00c301f 100755 --- a/charts/kubezero-metrics/jsonnet/build.sh +++ b/charts/kubezero-metrics/jsonnet/build.sh @@ -12,9 +12,3 @@ else #jb install github.com/prometheus-operator/kube-prometheus/jsonnet/kube-prometheus@main jb install github.com/prometheus-operator/kube-prometheus/jsonnet/kube-prometheus@release-0.10 fi - -make clean -jsonnet -J vendor -m dashboards -e '(import "dashboards.libsonnet").grafanaDashboards' - -#jsonnet -J vendor -m rules rules.libsonnet | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml' -- {} -jsonnet -J vendor -m rules rules.libsonnet diff --git a/charts/kubezero-metrics/jsonnet/jsonnetfile.lock.json b/charts/kubezero-metrics/jsonnet/jsonnetfile.lock.json index 2dabac19..e97ee293 100644 --- a/charts/kubezero-metrics/jsonnet/jsonnetfile.lock.json +++ b/charts/kubezero-metrics/jsonnet/jsonnetfile.lock.json @@ -18,7 +18,7 @@ "subdir": "contrib/mixin" } }, - "version": "3ace62279270ef83c48496ba1a01fb38abe7f76a", + "version": "b872757492ca70f350abd44eb95d81b95339f581", "sum": "W/Azptf1PoqjyMwJON96UY69MFugDA4IAYiKURscryc=" }, { @@ -38,7 +38,7 @@ "subdir": "grafana-builder" } }, - "version": "318a65120918fe8e298ffc8e63b9e941677ef321", + "version": "5fb2525651cc6e5100e081b10ad9fbe7e3595231", "sum": "0KkygBQd/AFzUvVzezE4qF/uDYgrwUXVpZfINBti0oc=" }, { @@ -58,7 +58,7 @@ "subdir": "lib/promgrafonnet" } }, - "version": "f2b5aab16039e7aa78c1b39aad1ec63d87eca85e", + "version": "62ad10fe9ceb53c6b846871997abbfe8e0bd7cf5", "sum": "zv7hXGui6BfHzE9wPatHI/AGZa4A2WKo6pq7ZdqBsps=" }, { @@ -88,8 +88,8 @@ "subdir": "jsonnet/kube-prometheus" } }, - "version": "c8db3c85db6e13b94726b7c5d630a6ebe7038cf9", - "sum": "7DfVEg2kDzIQPgxTThnjQ4S2ZksrF0hkNLysXP6Wv24=" + "version": "452aaed72e36acb31cae93cfa85a5d9c3d3d2ec7", + "sum": "pupXEvlRbhLdEO9b8LfFZB66+Z7fEqvRZ9m3MyEvsv4=" }, { "source": { diff --git a/charts/kubezero-metrics/update.sh b/charts/kubezero-metrics/update.sh index 933e0f9f..e9381316 100755 --- a/charts/kubezero-metrics/update.sh +++ b/charts/kubezero-metrics/update.sh @@ -16,8 +16,7 @@ patch -p0 -i zdt.patch --no-backup-if-mismatch patch -p0 -i zdt-pushgateway.patch --no-backup-if-mismatch # Create ZDT dashboard, alerts etc configmaps -cd jsonnet -./build.sh +cd jsonnet && make ../sync_grafana_dashboards.py metrics-dashboards.yaml ../templates/grafana-dashboards-metrics.yaml ../sync_grafana_dashboards.py k8s-dashboards.yaml ../templates/grafana-dashboards-k8s.yaml